इवेंट बनाता है. इसे अभी आज़माएं या उदाहरण देखें.
अनुरोध
एचटीटीपी अनुरोध
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events
पैरामीटर
पैरामीटर का नाम | वैल्यू | ब्यौरा |
---|---|---|
पाथ पैरामीटर | ||
calendarId |
string |
कैलेंडर आइडेंटिफ़ायर. कैलेंडर आईडी फिर से पाने के लिए, calendarList.list तरीके को कॉल करें. अगर आपको इस समय लॉग इन किए हुए उपयोगकर्ता के प्राथमिक कैलेंडर को ऐक्सेस करना है, तो "primary " कीवर्ड का इस्तेमाल करें.
|
वैकल्पिक क्वेरी पैरामीटर | ||
conferenceDataVersion |
integer |
कॉन्फ़्रेंस डेटा का वर्शन नंबर जो एपीआई क्लाइंट के साथ काम करता है. वर्शन 0 में यह माना जाता है कि कोई कॉन्फ़्रेंस डेटा काम नहीं करेगा और इवेंट के मुख्य हिस्से में कॉन्फ़्रेंस के डेटा को अनदेखा कर देगा. वर्शन 1 में कॉन्फ़्रेंस डेटा को कॉपी करने के साथ-साथ, कॉन्फ़्रेंसData के createRequest फ़ील्ड का इस्तेमाल करके नई कॉन्फ़्रेंस बनाने की सुविधा चालू की गई है. डिफ़ॉल्ट वैल्यू 0 होती है.
स्वीकार्य मान 0 से 1 तक हो सकते हैं, जिसमें ये भी शामिल हैं.
|
maxAttendees |
integer |
जवाब में शामिल किए जाने वाले मेहमानों की ज़्यादा से ज़्यादा संख्या. अगर मेहमानों की तय संख्या से ज़्यादा लोग हैं, तो मीटिंग में हिस्सा लेने वाले व्यक्ति को ही लौटाया जाता है. ज़रूरी नहीं. |
sendNotifications |
boolean |
समर्थन नहीं होना या रुकना. इसके बजाय, कृपया sendUpdates का इस्तेमाल करें. नया इवेंट बनाने के बारे में सूचनाएं भेजना है या नहीं. ध्यान दें कि अगर आपने वैल्यू को false पर सेट किया है, तो भी कुछ ईमेल भेजे जा सकते हैं. डिफ़ॉल्ट वैल्यू false है.
|
sendUpdates |
string |
नया इवेंट बनाने के बारे में सूचनाएं भेजी जाएं या नहीं. ध्यान दें कि कुछ ईमेल अब भी भेजे जा सकते हैं. डिफ़ॉल्ट वैल्यू false है.
स्वीकार की जाने वाली वैल्यू हैं:
|
supportsAttachments |
boolean |
इवेंट अटैचमेंट के साथ काम करने वाले एपीआई क्लाइंट की कार्रवाई की जा सकती है या नहीं. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है. |
अनुमति देना
इस अनुरोध के लिए, अनुमति देने के लिए, इनमें से कम से कम एक दायरे को शामिल करना ज़रूरी है:
स्कोप |
---|
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.events |
ज़्यादा जानकारी के लिए, पुष्टि करना और अनुमति देना पेज देखें.
अनुरोध का मुख्य भाग
अनुरोध के मुख्य हिस्से में, इन प्रॉपर्टी के साथ इवेंट संसाधन दें:
प्रॉपर्टी का नाम | वैल्यू | ब्यौरा | ज़रूरी जानकारी |
---|---|---|---|
ज़रूरी प्रॉपर्टी | |||
end |
nested object |
इवेंट के खत्म होने का समय (खास समय). बार-बार होने वाले इवेंट के लिए, यह पहली बार इवेंट खत्म होने का समय होता है. | |
start |
nested object |
इवेंट के शुरू होने का समय. बार-बार होने वाले इवेंट के लिए, यह पहली बार इवेंट के शुरू होने का समय होता है. | |
वैकल्पिक प्रॉपर्टी | |||
anyoneCanAddSelf |
boolean |
कोई भी व्यक्ति खुद को इवेंट में न्योता दे सकता है या नहीं (अब सेवा में नहीं है). ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है. | लिखने योग्य |
attachments[].fileUrl |
string |
अटैचमेंट का यूआरएल लिंक. Google Drive में मौजूद फ़ाइलों के अटैचमेंट जोड़ने के लिए, उसी फ़ॉर्मैट का इस्तेमाल करें जो Drive API में अटैचमेंट जोड़ते समय ज़रूरी है. |
लिखने योग्य |
attendees[] |
list |
इवेंट के मेहमान. कैलेंडर के अन्य उपयोगकर्ताओं के साथ इवेंट शेड्यूल करने के बारे में ज़्यादा जानकारी के लिए, मेहमान के साथ इवेंट गाइड देखें. सेवा खातों को, डोमेन के सभी उपयोगकर्ताओं को अनुमति देने की प्रक्रिया का इस्तेमाल करना होगा, ताकि मेहमानों की सूची में उनका डेटा शामिल किया जा सके. | लिखने योग्य |
attendees[].additionalGuests |
integer |
अतिरिक्त मेहमानों की संख्या. ज़रूरी नहीं. डिफ़ॉल्ट वैल्यू 0 होती है. | लिखने योग्य |
attendees[].comment |
string |
मेहमान की जवाब टिप्पणी. ज़रूरी नहीं. | लिखने योग्य |
attendees[].displayName |
string |
मेहमान का नाम, अगर उपलब्ध हो. ज़रूरी नहीं. | लिखने योग्य |
attendees[].email |
string |
मेहमान का ईमेल पता, अगर उपलब्ध हो. किसी मेहमान को जोड़ते समय यह फ़ील्ड मौजूद होना चाहिए. यह RFC5322 के मुताबिक एक मान्य ईमेल पता होना चाहिए. मेहमान को जोड़ते समय ज़रूरी है. |
लिखने योग्य |
attendees[].optional |
boolean |
क्या यह एक वैकल्पिक मेहमान है. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है. | लिखने योग्य |
attendees[].resource |
boolean |
मेहमान के पास संसाधन है या नहीं. इवेंट में पहली बार मेहमान जोड़े जाने के बाद ही, यह सेट किया जा सकता है. बाद के बदलावों को अनदेखा कर दिया जाता है. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है. | लिखने योग्य |
attendees[].responseStatus |
string |
मेहमान के जवाब की स्थिति. आपको ये वैल्यू दिख सकती हैं:
|
लिखने योग्य |
colorId |
string |
इवेंट का रंग. यह आईडी, कलर की परिभाषा के event सेक्शन में मौजूद एंट्री के बारे में बताता है. इसके लिए, कलर का एंडपॉइंट देखें. ज़रूरी नहीं. |
लिखने योग्य |
conferenceData |
nested object |
कॉन्फ़्रेंस से जुड़ी जानकारी, जैसे कि Google Meet कॉन्फ़्रेंस का ब्यौरा. नई कॉन्फ़्रेंस की जानकारी बनाने के लिए, createRequest फ़ील्ड का इस्तेमाल करें. अगर आपको बदलाव बनाए रखने हैं, तो इवेंट में बदलाव के सभी अनुरोधों के लिए, conferenceDataVersion अनुरोध पैरामीटर को 1 पर सेट करना न भूलें. |
लिखने योग्य |
description |
string |
इवेंट के बारे में जानकारी. इसमें एचटीएमएल हो सकता है. ज़रूरी नहीं. | लिखने योग्य |
end.date |
date |
अगर यह पूरे दिन का इवेंट है, तो "yyyy-mm-dd" फ़ॉर्मैट में तारीख. | लिखने योग्य |
end.dateTime |
datetime |
समय, तारीख और समय की कुल वैल्यू (RFC3339 के हिसाब से फ़ॉर्मैट) के तौर पर. अगर timeZone में टाइम ज़ोन के बारे में साफ़ तौर पर नहीं बताया गया है, तो टाइम ज़ोन ऑफ़सेट ज़रूरी है. |
लिखने योग्य |
end.timeZone |
string |
वह टाइम ज़ोन जिसमें समय बताया गया है. (IANA टाइम ज़ोन डेटाबेस के नाम के तौर पर फ़ॉर्मैट किया गया, जैसे कि "यूरोप/ज़ूरिख".) बार-बार होने वाले इवेंट के लिए, यह फ़ील्ड ज़रूरी है. साथ ही, इससे उस टाइम ज़ोन के बारे में पता चलता है जिसमें बार-बार होने वाले इवेंट को बड़ा किया जाता है. किसी एक इवेंट के लिए, यह फ़ील्ड ज़रूरी नहीं है. साथ ही, यह इवेंट के शुरू/खत्म होने का कस्टम टाइम ज़ोन दिखाता है. | लिखने योग्य |
eventType |
string |
खास तरह का इवेंट. इवेंट बनाने के बाद, इसमें बदलाव नहीं किया जा सकता. आपको ये वैल्यू दिख सकती हैं:
default " और "workingLocation " इवेंट बनाए जा सकते हैं. अन्य इवेंट टाइप के लिए अतिरिक्त सहायता, बाद की रिलीज़ में उपलब्ध कराई जाएगी. |
लिखने योग्य |
extendedProperties.private |
object |
ऐसी प्रॉपर्टी जो इस कैलेंडर में दिखने वाले इवेंट की कॉपी के लिए निजी हैं. | लिखने योग्य |
extendedProperties.shared |
object |
ऐसी प्रॉपर्टी जिन्हें दूसरे मेहमानों के कैलेंडर में, इवेंट की कॉपी के बीच शेयर किया जाता है. | लिखने योग्य |
focusTimeProperties |
nested object |
फ़ोकस टाइम इवेंट का डेटा. अगर eventType , focusTime है, तो इसका इस्तेमाल किया जाता है. |
लिखने योग्य |
gadget.display |
string |
गैजेट का प्रदर्शन मोड. समर्थन नहीं होना या रुकना. आपको ये वैल्यू दिख सकती हैं:
|
लिखने योग्य |
gadget.height |
integer |
पिक्सल में गैजेट की ऊंचाई. ऊंचाई 0 से ज़्यादा कोई पूर्णांक होना चाहिए. ज़रूरी नहीं. समर्थन नहीं होना या रुकना. | लिखने योग्य |
gadget.iconLink |
string |
गैजेट के आइकॉन का यूआरएल. यूआरएल स्कीम, एचटीटीपीएस में होनी चाहिए. समर्थन नहीं होना या रुकना. | लिखने योग्य |
gadget.link |
string |
गैजेट का यूआरएल. यूआरएल स्कीम, एचटीटीपीएस में होनी चाहिए. समर्थन नहीं होना या रुकना. | लिखने योग्य |
gadget.preferences |
object |
प्राथमिकताएं पर टैप करें. | लिखने योग्य |
gadget.title |
string |
गैजेट का शीर्षक. समर्थन नहीं होना या रुकना. | लिखने योग्य |
gadget.type |
string |
गैजेट का टाइप. समर्थन नहीं होना या रुकना. | लिखने योग्य |
gadget.width |
integer |
पिक्सल में गैजेट की चौड़ाई. चौड़ाई 0 से ज़्यादा पूर्णांक में होनी चाहिए. ज़रूरी नहीं. समर्थन नहीं होना या रुकना. | लिखने योग्य |
guestsCanInviteOthers |
boolean |
क्या आयोजक के अलावा, दूसरे लोग भी इवेंट में शामिल होने का न्योता भेज सकते हैं. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह 'सही' पर सेट होती है. | लिखने योग्य |
guestsCanModify |
boolean |
क्या आयोजक के अलावा अन्य मेहमान इवेंट में बदलाव कर सकते हैं. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है. | लिखने योग्य |
guestsCanSeeOtherGuests |
boolean |
क्या आयोजक के अलावा अन्य मेहमान यह देख सकते हैं कि इवेंट के मेहमान कौन हैं. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह 'सही' पर सेट होती है. | लिखने योग्य |
id |
string |
इवेंट का ओपेक आइडेंटिफ़ायर. नए सिंगल या बार-बार होने वाले इवेंट बनाते समय, उनके आईडी तय किए जा सकते हैं. दिए गए आईडी को इन नियमों के मुताबिक होना चाहिए:
अगर आप कोई आईडी नहीं देते हैं, तो सर्वर उसे अपने-आप जनरेट कर देगा. ध्यान दें कि |
लिखने योग्य |
location |
string |
फ़्री फ़ॉर्म टेक्स्ट के तौर पर इवेंट की जगह. ज़रूरी नहीं. | लिखने योग्य |
originalStartTime.date |
date |
अगर यह पूरे दिन का इवेंट है, तो "yyyy-mm-dd" फ़ॉर्मैट में तारीख. | लिखने योग्य |
originalStartTime.dateTime |
datetime |
समय, तारीख और समय की कुल वैल्यू (RFC3339 के हिसाब से फ़ॉर्मैट) के तौर पर. अगर timeZone में टाइम ज़ोन के बारे में साफ़ तौर पर नहीं बताया गया है, तो टाइम ज़ोन ऑफ़सेट ज़रूरी है. |
लिखने योग्य |
originalStartTime.timeZone |
string |
वह टाइम ज़ोन जिसमें समय बताया गया है. (IANA टाइम ज़ोन डेटाबेस के नाम के तौर पर फ़ॉर्मैट किया गया, जैसे कि "यूरोप/ज़ूरिख".) बार-बार होने वाले इवेंट के लिए, यह फ़ील्ड ज़रूरी है. साथ ही, इससे उस टाइम ज़ोन के बारे में पता चलता है जिसमें बार-बार होने वाले इवेंट को बड़ा किया जाता है. किसी एक इवेंट के लिए, यह फ़ील्ड ज़रूरी नहीं है. साथ ही, यह इवेंट के शुरू/खत्म होने का कस्टम टाइम ज़ोन दिखाता है. | लिखने योग्य |
outOfOfficeProperties |
nested object |
'अभी मैं छुट्टी पर हूं' इवेंट का डेटा. अगर eventType , outOfOffice है, तो इसका इस्तेमाल किया जाता है. |
लिखने योग्य |
recurrence[] |
list |
RFC5545 में दी गई जानकारी के हिसाब से, बार-बार होने वाले इवेंट के लिए RRT, EX खान, RDATE, और EXDATE लाइनों की सूची. ध्यान दें कि इस फ़ील्ड में DTSTART और DTEND लाइनों की अनुमति नहीं है. इवेंट के शुरू और खत्म होने के समय की जानकारी start और end फ़ील्ड में दी गई है. यह फ़ील्ड किसी एक इवेंट या बार-बार होने वाले इवेंट के लिए छोड़ दिया जाता है. |
लिखने योग्य |
reminders.overrides[] |
list |
अगर इवेंट में डिफ़ॉल्ट रिमाइंडर का इस्तेमाल नहीं किया जाता है, तो इससे उस इवेंट के लिए खास रिमाइंडर की सूची बन जाती है. अगर सेट नहीं किया गया है, तो यह दिखाता है कि इस इवेंट के लिए कोई रिमाइंडर सेट नहीं है. रिमाइंडर बदलने की ज़्यादा से ज़्यादा संख्या पांच हो सकती है. | लिखने योग्य |
reminders.overrides[].method |
string |
इस रिमाइंडर में इस्तेमाल किया गया तरीका. आपको ये वैल्यू दिख सकती हैं:
रिमाइंडर जोड़ते समय ज़रूरी है. |
लिखने योग्य |
reminders.overrides[].minutes |
integer |
रिमाइंडर ट्रिगर होने के बाद, इवेंट शुरू होने के कितने मिनट पहले ट्रिगर होना चाहिए. मान्य वैल्यू 0 से 40320 के बीच होती हैं (मिनट में चार हफ़्ते). रिमाइंडर जोड़ते समय ज़रूरी है. |
लिखने योग्य |
reminders.useDefault |
boolean |
क्या इवेंट पर कैलेंडर के डिफ़ॉल्ट रिमाइंडर लागू होते हैं. | लिखने योग्य |
sequence |
integer |
iCalendar के मुताबिक क्रम का नंबर. | लिखने योग्य |
source.title |
string |
सोर्स का टाइटल, जैसे कि वेब पेज का टाइटल या ईमेल का विषय. | लिखने योग्य |
source.url |
string |
किसी संसाधन पर ले जाने वाले सोर्स का यूआरएल. यूआरएल स्कीम, एचटीटीपी या एचटीटीपीएस होनी चाहिए. | लिखने योग्य |
start.date |
date |
अगर यह पूरे दिन का इवेंट है, तो "yyyy-mm-dd" फ़ॉर्मैट में तारीख. | लिखने योग्य |
start.dateTime |
datetime |
समय, तारीख और समय की कुल वैल्यू (RFC3339 के हिसाब से फ़ॉर्मैट) के तौर पर. अगर timeZone में टाइम ज़ोन के बारे में साफ़ तौर पर नहीं बताया गया है, तो टाइम ज़ोन ऑफ़सेट ज़रूरी है. |
लिखने योग्य |
start.timeZone |
string |
वह टाइम ज़ोन जिसमें समय बताया गया है. (IANA टाइम ज़ोन डेटाबेस के नाम के तौर पर फ़ॉर्मैट किया गया, जैसे कि "यूरोप/ज़ूरिख".) बार-बार होने वाले इवेंट के लिए, यह फ़ील्ड ज़रूरी है. साथ ही, इससे उस टाइम ज़ोन के बारे में पता चलता है जिसमें बार-बार होने वाले इवेंट को बड़ा किया जाता है. किसी एक इवेंट के लिए, यह फ़ील्ड ज़रूरी नहीं है. साथ ही, यह इवेंट के शुरू/खत्म होने का कस्टम टाइम ज़ोन दिखाता है. | लिखने योग्य |
status |
string |
इवेंट की स्थिति. ज़रूरी नहीं. आपको ये वैल्यू दिख सकती हैं:
|
लिखने योग्य |
summary |
string |
इवेंट का शीर्षक. | लिखने योग्य |
transparency |
string |
इवेंट, कैलेंडर पर समय को ब्लॉक करता है या नहीं. ज़रूरी नहीं. आपको ये वैल्यू दिख सकती हैं:
|
लिखने योग्य |
visibility |
string |
इवेंट की दृश्यता. ज़रूरी नहीं. आपको ये वैल्यू दिख सकती हैं:
|
लिखने योग्य |
workingLocationProperties |
nested object |
काम करने की जगह से जुड़े इवेंट का डेटा. | लिखने योग्य |
workingLocationProperties.customLocation |
object |
मौजूद होने पर, यह बताता है कि उपयोगकर्ता किसी कस्टम जगह से काम कर रहा है. | लिखने योग्य |
workingLocationProperties.customLocation.label |
string |
ज़्यादा जानकारी के लिए एक वैकल्पिक लेबल. | लिखने योग्य |
workingLocationProperties.homeOffice |
any value |
अगर यह मौजूद हो, तो इससे पता चलता है कि उपयोगकर्ता घर पर काम कर रहा है. | लिखने योग्य |
workingLocationProperties.officeLocation |
object |
अगर यह मौजूद है, तो इससे पता चलता है कि उपयोगकर्ता ऑफ़िस से काम कर रहा है. | लिखने योग्य |
workingLocationProperties.officeLocation.buildingId |
string |
एक वैकल्पिक इमारत का आइडेंटिफ़ायर. इसे संगठन के संसाधन डेटाबेस में बिल्डिंग आईडी के बारे में बताना चाहिए. | लिखने योग्य |
workingLocationProperties.officeLocation.deskId |
string |
एक वैकल्पिक डेस्क आइडेंटिफ़ायर. | लिखने योग्य |
workingLocationProperties.officeLocation.floorId |
string |
वैकल्पिक फ़्लोर आइडेंटिफ़ायर. | लिखने योग्य |
workingLocationProperties.officeLocation.floorSectionId |
string |
फ़्लोर सेक्शन का एक वैकल्पिक आइडेंटिफ़ायर. | लिखने योग्य |
workingLocationProperties.officeLocation.label |
string |
ऑफ़िस का वह नाम जो Calendar के वेब और मोबाइल क्लाइंट में दिखता है. हमारा सुझाव है कि आप संगठन के संसाधन डेटाबेस में इमारत का नाम बताएं. | लिखने योग्य |
workingLocationProperties.type |
string |
काम करने की जगह किस तरह की है. आपको ये वैल्यू दिख सकती हैं:
काम करने की जगह वाली प्रॉपर्टी जोड़ने के लिए ज़रूरी है. |
लिखने योग्य |
जवाब
कामयाब होने पर, यह तरीका रिस्पॉन्स के मुख्य हिस्से में इवेंट रिसॉर्स दिखाता है.
उदाहरण
ध्यान दें: इस तरीके के लिए दिए गए कोड के उदाहरणों में इसके साथ काम करने वाली सभी प्रोग्रामिंग भाषाएं नहीं दिखाई गई हैं (इसके साथ काम करने वाली भाषाओं की सूची के लिए क्लाइंट लाइब्रेरी वाला पेज देखें).
Java
Java क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
// Refer to the Java quickstart on how to setup the environment: // https://developers.google.com/calendar/quickstart/java // Change the scope to CalendarScopes.CALENDAR and delete any stored // credentials. Event event = new Event() .setSummary("Google I/O 2015") .setLocation("800 Howard St., San Francisco, CA 94103") .setDescription("A chance to hear more about Google's developer products."); DateTime startDateTime = new DateTime("2015-05-28T09:00:00-07:00"); EventDateTime start = new EventDateTime() .setDateTime(startDateTime) .setTimeZone("America/Los_Angeles"); event.setStart(start); DateTime endDateTime = new DateTime("2015-05-28T17:00:00-07:00"); EventDateTime end = new EventDateTime() .setDateTime(endDateTime) .setTimeZone("America/Los_Angeles"); event.setEnd(end); String[] recurrence = new String[] {"RRULE:FREQ=DAILY;COUNT=2"}; event.setRecurrence(Arrays.asList(recurrence)); EventAttendee[] attendees = new EventAttendee[] { new EventAttendee().setEmail("lpage@example.com"), new EventAttendee().setEmail("sbrin@example.com"), }; event.setAttendees(Arrays.asList(attendees)); EventReminder[] reminderOverrides = new EventReminder[] { new EventReminder().setMethod("email").setMinutes(24 * 60), new EventReminder().setMethod("popup").setMinutes(10), }; Event.Reminders reminders = new Event.Reminders() .setUseDefault(false) .setOverrides(Arrays.asList(reminderOverrides)); event.setReminders(reminders); String calendarId = "primary"; event = service.events().insert(calendarId, event).execute(); System.out.printf("Event created: %s\n", event.getHtmlLink());
Python
Python क्लाइंट लाइब्रेरी का इस्तेमाल करता हो.
# Refer to the Python quickstart on how to setup the environment: # https://developers.google.com/calendar/quickstart/python # Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any # stored credentials. event = { 'summary': 'Google I/O 2015', 'location': '800 Howard St., San Francisco, CA 94103', 'description': 'A chance to hear more about Google\'s developer products.', 'start': { 'dateTime': '2015-05-28T09:00:00-07:00', 'timeZone': 'America/Los_Angeles', }, 'end': { 'dateTime': '2015-05-28T17:00:00-07:00', 'timeZone': 'America/Los_Angeles', }, 'recurrence': [ 'RRULE:FREQ=DAILY;COUNT=2' ], 'attendees': [ {'email': 'lpage@example.com'}, {'email': 'sbrin@example.com'}, ], 'reminders': { 'useDefault': False, 'overrides': [ {'method': 'email', 'minutes': 24 * 60}, {'method': 'popup', 'minutes': 10}, ], }, } event = service.events().insert(calendarId='primary', body=event).execute() print 'Event created: %s' % (event.get('htmlLink'))
PHP
PHP क्लाइंट लाइब्रेरी का इस्तेमाल करता हो.
// Refer to the PHP quickstart on how to setup the environment: // https://developers.google.com/calendar/quickstart/php // Change the scope to Google_Service_Calendar::CALENDAR and delete any stored // credentials. $event = new Google_Service_Calendar_Event(array( 'summary' => 'Google I/O 2015', 'location' => '800 Howard St., San Francisco, CA 94103', 'description' => 'A chance to hear more about Google\'s developer products.', 'start' => array( 'dateTime' => '2015-05-28T09:00:00-07:00', 'timeZone' => 'America/Los_Angeles', ), 'end' => array( 'dateTime' => '2015-05-28T17:00:00-07:00', 'timeZone' => 'America/Los_Angeles', ), 'recurrence' => array( 'RRULE:FREQ=DAILY;COUNT=2' ), 'attendees' => array( array('email' => 'lpage@example.com'), array('email' => 'sbrin@example.com'), ), 'reminders' => array( 'useDefault' => FALSE, 'overrides' => array( array('method' => 'email', 'minutes' => 24 * 60), array('method' => 'popup', 'minutes' => 10), ), ), )); $calendarId = 'primary'; $event = $service->events->insert($calendarId, $event); printf('Event created: %s\n', $event->htmlLink);
Ruby
Ruby क्लाइंट लाइब्रेरी का इस्तेमाल करता हो.
event = Google::Apis::CalendarV3::Event.new( summary: 'Google I/O 2015', location: '800 Howard St., San Francisco, CA 94103', description: 'A chance to hear more about Google\'s developer products.', start: Google::Apis::CalendarV3::EventDateTime.new( date_time: '2015-05-28T09:00:00-07:00', time_zone: 'America/Los_Angeles' ), end: Google::Apis::CalendarV3::EventDateTime.new( date_time: '2015-05-28T17:00:00-07:00', time_zone: 'America/Los_Angeles' ), recurrence: [ 'RRULE:FREQ=DAILY;COUNT=2' ], attendees: [ Google::Apis::CalendarV3::EventAttendee.new( email: 'lpage@example.com' ), Google::Apis::CalendarV3::EventAttendee.new( email: 'sbrin@example.com' ) ], reminders: Google::Apis::CalendarV3::Event::Reminders.new( use_default: false, overrides: [ Google::Apis::CalendarV3::EventReminder.new( reminder_method: 'email', minutes: 24 * 60 ), Google::Apis::CalendarV3::EventReminder.new( reminder_method: 'popup', minutes: 10 ) ] ) ) result = client.insert_event('primary', event) puts "Event created: #{result.html_link}"
.NET
.NET क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
// Refer to the .NET quickstart on how to setup the environment: // https://developers.google.com/calendar/quickstart/dotnet // Change the scope to CalendarService.Scope.Calendar and delete any stored // credentials. Event newEvent = new Event() { Summary = "Google I/O 2015", Location = "800 Howard St., San Francisco, CA 94103", Description = "A chance to hear more about Google's developer products.", Start = new EventDateTime() { DateTime = DateTime.Parse("2015-05-28T09:00:00-07:00"), TimeZone = "America/Los_Angeles", }, End = new EventDateTime() { DateTime = DateTime.Parse("2015-05-28T17:00:00-07:00"), TimeZone = "America/Los_Angeles", }, Recurrence = new String[] { "RRULE:FREQ=DAILY;COUNT=2" }, Attendees = new EventAttendee[] { new EventAttendee() { Email = "lpage@example.com" }, new EventAttendee() { Email = "sbrin@example.com" }, }, Reminders = new Event.RemindersData() { UseDefault = false, Overrides = new EventReminder[] { new EventReminder() { Method = "email", Minutes = 24 * 60 }, new EventReminder() { Method = "sms", Minutes = 10 }, } } }; String calendarId = "primary"; EventsResource.InsertRequest request = service.Events.Insert(newEvent, calendarId); Event createdEvent = request.Execute(); Console.WriteLine("Event created: {0}", createdEvent.HtmlLink);
शुरू करें
Go क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
// Refer to the Go quickstart on how to setup the environment: // https://developers.google.com/calendar/quickstart/go // Change the scope to calendar.CalendarScope and delete any stored credentials. event := &calendar.Event{ Summary: "Google I/O 2015", Location: "800 Howard St., San Francisco, CA 94103", Description: "A chance to hear more about Google's developer products.", Start: &calendar.EventDateTime{ DateTime: "2015-05-28T09:00:00-07:00", TimeZone: "America/Los_Angeles", }, End: &calendar.EventDateTime{ DateTime: "2015-05-28T17:00:00-07:00", TimeZone: "America/Los_Angeles", }, Recurrence: []string{"RRULE:FREQ=DAILY;COUNT=2"}, Attendees: []*calendar.EventAttendee{ &calendar.EventAttendee{Email:"lpage@example.com"}, &calendar.EventAttendee{Email:"sbrin@example.com"}, }, } calendarId := "primary" event, err = srv.Events.Insert(calendarId, event).Do() if err != nil { log.Fatalf("Unable to create event. %v\n", err) } fmt.Printf("Event created: %s\n", event.HtmlLink)
JavaScript
JavaScript क्लाइंट लाइब्रेरी का इस्तेमाल करती हो.
// Refer to the JavaScript quickstart on how to setup the environment: // https://developers.google.com/calendar/quickstart/js // Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any // stored credentials. var event = { 'summary': 'Google I/O 2015', 'location': '800 Howard St., San Francisco, CA 94103', 'description': 'A chance to hear more about Google\'s developer products.', 'start': { 'dateTime': '2015-05-28T09:00:00-07:00', 'timeZone': 'America/Los_Angeles' }, 'end': { 'dateTime': '2015-05-28T17:00:00-07:00', 'timeZone': 'America/Los_Angeles' }, 'recurrence': [ 'RRULE:FREQ=DAILY;COUNT=2' ], 'attendees': [ {'email': 'lpage@example.com'}, {'email': 'sbrin@example.com'} ], 'reminders': { 'useDefault': false, 'overrides': [ {'method': 'email', 'minutes': 24 * 60}, {'method': 'popup', 'minutes': 10} ] } }; var request = gapi.client.calendar.events.insert({ 'calendarId': 'primary', 'resource': event }); request.execute(function(event) { appendPre('Event created: ' + event.htmlLink); });
Node.js
Node.js क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
// Refer to the Node.js quickstart on how to setup the environment: // https://developers.google.com/calendar/quickstart/node // Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any // stored credentials. var event = { 'summary': 'Google I/O 2015', 'location': '800 Howard St., San Francisco, CA 94103', 'description': 'A chance to hear more about Google\'s developer products.', 'start': { 'dateTime': '2015-05-28T09:00:00-07:00', 'timeZone': 'America/Los_Angeles', }, 'end': { 'dateTime': '2015-05-28T17:00:00-07:00', 'timeZone': 'America/Los_Angeles', }, 'recurrence': [ 'RRULE:FREQ=DAILY;COUNT=2' ], 'attendees': [ {'email': 'lpage@example.com'}, {'email': 'sbrin@example.com'}, ], 'reminders': { 'useDefault': false, 'overrides': [ {'method': 'email', 'minutes': 24 * 60}, {'method': 'popup', 'minutes': 10}, ], }, }; calendar.events.insert({ auth: auth, calendarId: 'primary', resource: event, }, function(err, event) { if (err) { console.log('There was an error contacting the Calendar service: ' + err); return; } console.log('Event created: %s', event.htmlLink); });
इसे आज़माएं!
इस तरीके को लाइव डेटा पर कॉल करने और रिस्पॉन्स देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें.