कैलेंडर के लिए मेटाडेटा अपडेट होता है. इसे अभी आज़माएं या उदाहरण देखें.
अनुरोध करें
एचटीटीपी अनुरोध
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId
पैरामीटर
पैरामीटर का नाम | वैल्यू | जानकारी |
---|---|---|
पाथ पैरामीटर | ||
calendarId |
string |
कैलेंडर आइडेंटिफ़ायर. कैलेंडर आईडी फिर से पाने के लिए, calendarList.list तरीके पर कॉल करें. फ़िलहाल, लॉग इन किए हुए उपयोगकर्ता के मुख्य कैलेंडर को ऐक्सेस करने के लिए, "primary " कीवर्ड का इस्तेमाल करें.
|
अनुमति देना
इस अनुरोध के लिए नीचे दिए गए दायरे की अनुमति चाहिए:
अनुमति देने का |
---|
https://www.googleapis.com/auth/calendar |
ज़्यादा जानकारी के लिए, पुष्टि और अनुमति देना पेज देखें.
अनुरोध का मुख्य भाग
अनुरोध के मुख्य हिस्से में, इन प्रॉपर्टी के साथ कैलेंडर संसाधन उपलब्ध कराएं:
प्रॉपर्टी का नाम | वैल्यू | जानकारी | नोट |
---|---|---|---|
ज़रूरी प्रॉपर्टी नहीं | |||
description |
string |
कैलेंडर का ब्यौरा. ज़रूरी नहीं. | लिखा जा सकता है |
location |
string |
फ़्री फ़ॉर्म टेक्स्ट के तौर पर कैलेंडर की भौगोलिक जगह. ज़रूरी नहीं. | लिखा जा सकता है |
summary |
string |
कैलेंडर का शीर्षक. | लिखा जा सकता है |
timeZone |
string |
कैलेंडर का समय क्षेत्र. (IANA समय क्षेत्र डेटाबेस नाम, जैसे "यूरोप/ज़्यूरिख" के रूप में फ़ॉर्मैट किया गया.) ज़रूरी नहीं. | लिखा जा सकता है |
जवाब
अगर यह तरीका कारगर होता है, तो यह जवाब के मुख्य भाग में कैलेंडर संसाधन दिखाता है.
उदाहरण
ध्यान दें: इस तरीके के लिए दिए गए कोड के उदाहरणों में इसके साथ काम करने वाली सभी प्रोग्रामिंग भाषाएं नहीं दिखाई गई हैं (इसके साथ काम करने वाली भाषाओं की सूची के लिए क्लाइंट लाइब्रेरी वाला पेज देखें).
Java
Java क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
import com.google.api.services.calendar.Calendar; // ... // Initialize Calendar service with valid OAuth credentials Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials) .setApplicationName("applicationName").build(); // Retrieve a calendar com.google.api.services.calendar.model.Calendar calendar = service.calendars().get('primary').execute(); // Make a change calendar.setSummary("calendarSummary"); // Update the altered calendar com.google.api.services.calendar.model.Calendar updatedCalendar = service.calendars().update(calendar.getId(), calendar).execute(); System.out.println(updatedCalendar.getEtag());
Python
Python क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
# First retrieve the calendar from the API. calendar = service.calendars().get(calendarId='primary').execute() calendar['summary'] = 'New Summary' updated_calendar = service.calendars().update(calendarId=calendar['id'], body=calendar).execute() print updated_calendar['etag']
PHP
PHP क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
// First retrieve the calendar from the API. $calendar = $service->calendars->get('primary'); $calendar->setSummary('New Summary'); $updatedCalendar = $service->calendars->update('primary', $calendar); echo $updatedCalendar->getEtag();
Ruby
Ruby क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
calendar = client.get_calendar('primary') calendar.summary = "New Summary" result = client.update_calendar(calendar.id, calendar) print result.etag
इसे आज़माएं!
इस तरीके को लाइव डेटा पर कॉल करने और जवाब देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें.