उपयोगकर्ता की कैलेंडर सूची पर एक मौजूदा कैलेंडर अपडेट करता है. इसे अभी आज़माएं या उदाहरण देखें.
अनुरोध करें
एचटीटीपी अनुरोध
PUT https://www.googleapis.com/calendar/v3/users/me/calendarList/calendarId
पैरामीटर
पैरामीटर का नाम | वैल्यू | जानकारी |
---|---|---|
पाथ पैरामीटर | ||
calendarId |
string |
कैलेंडर आइडेंटिफ़ायर. कैलेंडर आईडी फिर से पाने के लिए, calendarList.list तरीके पर कॉल करें. फ़िलहाल, लॉग इन किए हुए उपयोगकर्ता के मुख्य कैलेंडर को ऐक्सेस करने के लिए, "primary " कीवर्ड का इस्तेमाल करें.
|
वैकल्पिक क्वेरी पैरामीटर | ||
colorRgbFormat |
boolean |
कैलेंडर के रंग (RGB) लिखने के लिए, foregroundColor और backgroundColor फ़ील्ड का इस्तेमाल करना है या नहीं. अगर इस सुविधा का इस्तेमाल किया जाता है, तो इंडेक्स पर आधारित colorId फ़ील्ड, अपने-आप सबसे अच्छे मैचिंग विकल्प पर सेट हो जाएगा. ज़रूरी नहीं. डिफ़ॉल्ट रूप से, 'गलत है' पर क्लिक किया जाता है.
|
अनुमति देना
इस अनुरोध के लिए नीचे दिए गए दायरे की अनुमति चाहिए:
अनुमति देने का |
---|
https://www.googleapis.com/auth/calendar |
ज़्यादा जानकारी के लिए, पुष्टि और अनुमति देना पेज देखें.
अनुरोध का मुख्य भाग
अनुरोध के मुख्य हिस्से में इन प्रॉपर्टी के साथ, CalendarList रिसॉर्स को शामिल करें:
प्रॉपर्टी का नाम | वैल्यू | जानकारी | नोट |
---|---|---|---|
ज़रूरी प्रॉपर्टी नहीं | |||
backgroundColor |
string |
हेक्साडेसिमल फ़ॉर्मैट "#0088aa " में कैलेंडर का मुख्य रंग. यह प्रॉपर्टी, इंडेक्स पर आधारित colorId प्रॉपर्टी की जगह लेती है. इस प्रॉपर्टी को सेट करने या बदलने के लिए, आपको insert, update और patch तरीकों के पैरामीटर में, colorRgbFormat=true के बारे में बताना होगा. ज़रूरी नहीं. |
लिखा जा सकता है |
colorId |
string |
कैलेंडर का रंग. यह आईडी, कलर डेफ़िनिशन के calendar सेक्शन में की गई एंट्री का रेफ़रंस देती है (रंगों के एंडपॉइंट देखें). इस प्रॉपर्टी की जगह backgroundColor और foregroundColor प्रॉपर्टी ले रही है. इन्हें इस्तेमाल करते समय अनदेखा किया जा सकता है. ज़रूरी नहीं. |
लिखा जा सकता है |
defaultReminders[] |
list |
डिफ़ॉल्ट रिमाइंडर, जो पुष्टि किए गए उपयोगकर्ता के पास इस कैलेंडर के लिए हैं. | लिखा जा सकता है |
defaultReminders[].method |
string |
इस रिमाइंडर में इस्तेमाल किया गया तरीका. वैल्यू इस तरह की हो सकती हैं:
रिमाइंडर जोड़ते समय ज़रूरी है. |
लिखा जा सकता है |
defaultReminders[].minutes |
integer |
रिमाइंडर के ट्रिगर होने का समय, इवेंट शुरू होने से इतने मिनट पहले. वैल्यू, 0 से 40320 (मिनट में चार हफ़्ते) के बीच होती हैं. रिमाइंडर जोड़ते समय ज़रूरी है. |
लिखा जा सकता है |
foregroundColor |
string |
हेक्साडेसिमल फ़ॉर्मैट "#ffffff " में कैलेंडर का फ़ोरग्राउंड का रंग. यह प्रॉपर्टी, इंडेक्स पर आधारित colorId प्रॉपर्टी की जगह लेती है. इस प्रॉपर्टी को सेट करने या बदलने के लिए, आपको insert, update और patch तरीकों के पैरामीटर में, 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
इसे आज़माएं!
इस तरीके को लाइव डेटा पर कॉल करने और जवाब देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें.