उपयोगकर्ता की कैलेंडर सूची में मौजूदा कैलेंडर को अपडेट करता है. इसे अभी आज़माएं या उदाहरण देखें.
अनुरोध
एचटीटीपी अनुरोध
PUT https://www.googleapis.com/calendar/v3/users/me/calendarList/calendarId
पैरामीटर
पैरामीटर का नाम | वैल्यू | ब्यौरा |
---|---|---|
पाथ पैरामीटर | ||
calendarId |
string |
कैलेंडर आइडेंटिफ़ायर. कैलेंडर आईडी फिर से पाने के लिए, calendarList.list तरीके को कॉल करें. अगर आपको इस समय लॉग इन किए हुए उपयोगकर्ता के प्राथमिक कैलेंडर को ऐक्सेस करना है, तो "primary " कीवर्ड का इस्तेमाल करें.
|
वैकल्पिक क्वेरी पैरामीटर | ||
colorRgbFormat |
boolean |
कैलेंडर के रंग (आरजीबी) लिखने के लिए, foregroundColor और backgroundColor फ़ील्ड का इस्तेमाल करना है या नहीं. अगर इस सुविधा का इस्तेमाल किया जाता है, तो इंडेक्स पर आधारित colorId फ़ील्ड, सबसे अच्छे मिलान के विकल्प पर अपने-आप सेट हो जाएगा. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है.
|
अनुमति देना
इस अनुरोध के लिए, इस तरह के अनुरोध को अनुमति देना ज़रूरी है:
स्कोप |
---|
https://www.googleapis.com/auth/calendar |
ज़्यादा जानकारी के लिए, पुष्टि करना और अनुमति देना पेज देखें.
अनुरोध का मुख्य भाग
अनुरोध के मुख्य हिस्से में, नीचे दी गई प्रॉपर्टी के साथ CalendarList संसाधन उपलब्ध कराएं:
प्रॉपर्टी का नाम | वैल्यू | ब्यौरा | ज़रूरी जानकारी |
---|---|---|---|
वैकल्पिक प्रॉपर्टी | |||
backgroundColor |
string |
कैलेंडर का मुख्य रंग हेक्साडेसिमल फ़ॉर्मैट "#0088aa " में है. यह प्रॉपर्टी, इंडेक्स-आधारित colorId प्रॉपर्टी की जगह लेगी. इस प्रॉपर्टी को सेट करने या बदलने के लिए, आपको insert, अपडेट, और पैच तरीके के पैरामीटर में, colorRgbFormat=true के बारे में बताना होगा. ज़रूरी नहीं. |
लिखने योग्य |
colorId |
string |
कैलेंडर का रंग. यह एक आईडी है जो कलर की परिभाषा के calendar सेक्शन में मौजूद एंट्री के बारे में बताता है. इसके लिए, कलर एंडपॉइंट देखें. इस प्रॉपर्टी को backgroundColor और foregroundColor प्रॉपर्टी ने बदल दिया है और इन प्रॉपर्टी का इस्तेमाल करते समय इन्हें अनदेखा किया जा सकता है. ज़रूरी नहीं. |
लिखने योग्य |
defaultReminders[] |
list |
इस कैलेंडर के लिए वे डिफ़ॉल्ट रिमाइंडर जो पुष्टि किए गए उपयोगकर्ता के पास हैं. | लिखने योग्य |
defaultReminders[].method |
string |
इस रिमाइंडर में इस्तेमाल किया गया तरीका. आपको ये वैल्यू दिख सकती हैं:
रिमाइंडर जोड़ते समय ज़रूरी है. |
लिखने योग्य |
defaultReminders[].minutes |
integer |
रिमाइंडर ट्रिगर होने के बाद, इवेंट शुरू होने के कितने मिनट पहले ट्रिगर होना चाहिए. मान्य वैल्यू 0 से 40320 के बीच होती हैं (मिनट में चार हफ़्ते). रिमाइंडर जोड़ते समय ज़रूरी है. |
लिखने योग्य |
foregroundColor |
string |
कैलेंडर का हेक्साडेसिमल फ़ॉर्मैट "#ffffff " में फ़ोरग्राउंड रंग. यह प्रॉपर्टी, इंडेक्स-आधारित colorId प्रॉपर्टी की जगह ले लेगी. इस प्रॉपर्टी को सेट करने या बदलने के लिए, आपको insert, अपडेट, और पैच तरीके के पैरामीटर में, colorRgbFormat=true के बारे में बताना होगा. ज़रूरी नहीं. |
लिखने योग्य |
notificationSettings |
object |
वे सूचनाएं जो प्रमाणित उपयोगकर्ता को इस कैलेंडर के लिए मिल रही हैं. | लिखने योग्य |
notificationSettings.notifications[].method |
string |
सूचना भेजने के लिए इस्तेमाल किया गया तरीका. संभावित वैल्यू है:
सूचना जोड़ते समय ज़रूरी है. |
लिखने योग्य |
notificationSettings.notifications[].type |
string |
सूचना किस तरह की है. आपको ये वैल्यू दिख सकती हैं:
सूचना जोड़ते समय ज़रूरी है. |
लिखने योग्य |
selected |
boolean |
कैलेंडर का कॉन्टेंट, कैलेंडर के यूज़र इंटरफ़ेस (यूआई) में दिखता है या नहीं. ज़रूरी नहीं. डिफ़ॉल्ट रूप से यह वैल्यू 'गलत' पर सेट होती है. | लिखने योग्य |
summaryOverride |
string |
वह खास जानकारी जिसे पुष्टि किए गए उपयोगकर्ता ने इस कैलेंडर के लिए सेट किया है. ज़रूरी नहीं. | लिखने योग्य |
जवाब
कामयाब होने पर, यह तरीका रिस्पॉन्स के मुख्य हिस्से में CalendarList संसाधन दिखाता है.
उदाहरण
ध्यान दें: इस तरीके के लिए दिए गए कोड के उदाहरणों में इसके साथ काम करने वाली सभी प्रोग्रामिंग भाषाएं नहीं दिखाई गई हैं (इसके साथ काम करने वाली भाषाओं की सूची के लिए क्लाइंट लाइब्रेरी वाला पेज देखें).
Java
Java क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
import com.google.api.services.calendar.Calendar; import com.google.api.services.calendar.model.CalendarListEntry; // ... // Initialize Calendar service with valid OAuth credentials Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials) .setApplicationName("applicationName").build(); // Retrieve the calendar list entry CalendarListEntry calendarListEntry = service.calendarList().get("calendarId").execute(); // Make a change calendarListEntry.setColorId("newColorId"); // Update the altered entry CalendarListEntry updatedCalendarListEntry = service.calendarList().update(calendarListEntry.getId(), calendarListEntry).execute(); System.out.println(updatedCalendarListEntry.getEtag());
Python
Python क्लाइंट लाइब्रेरी का इस्तेमाल करता हो.
# First retrieve the calendarListEntry from the API. calendar_list_entry = service.calendarList().get(calendarId='calendarId').execute() calendar_list_entry['colorId'] = 'newColorId' updated_calendar_list_entry = service.calendarList().update( calendarId=calendar_list_entry['id'], body=calendar_list_entry).execute() print created_calendar_list_entry['etag']
PHP
PHP क्लाइंट लाइब्रेरी का इस्तेमाल करता हो.
// First retrieve the calendarListEntry from the API. $calendarListEntry = $service->calendarList->get('calendarId'); $calendarListEntry->setColorId('newColorId'); $updatedCalendarListEntry = service->calendarList->update($calendarListEntry->getId(), $calendarListEntry); echo $updatedCalendarListEntry->getEtag();
Ruby
Ruby क्लाइंट लाइब्रेरी का इस्तेमाल करता हो.
calendar_list_entry = client.get_calendar_list('calendarId') calendar_list_entry.colorId = 'newColorId' result = client.update_calendar_list(calendar_list_entry.id, calendar_list_entry) print result.etag
इसे आज़माएं!
इस तरीके को लाइव डेटा पर कॉल करने और रिस्पॉन्स देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें.