A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/advanced/calendar below:

Advanced Calendar Service | Apps Script

Skip to main content Advanced Calendar Service

Stay organized with collections Save and categorize content based on your preferences.

The advanced Calendar service allows you to use the public Google Calendar API in Apps Script. Much like Apps Script's built-in Calendar service, this API allows scripts to access and modify the user's Google Calendar, including additional calendars that the user is subscribed to. In most cases, the built-in service is easier to use, but this advanced service provides a few extra features, including setting the background color for individual events.

Note: This is an advanced service that must be enabled before use. Reference

For detailed information on this service, see the reference documentation for the public Google Calendar API. Like all advanced services in Apps Script, the advanced Calendar service uses the same objects, methods, and parameters as the public API. For more information, see How method signatures are determined.

To report issues and find other support, see the Calendar support guide.

The advanced Calendar service can accept the HTTP request headers If-Match and If-None-Match. For details, see the reference documentation.

Sample code

The sample code below uses version 3 of the API.

Creating events

The following example demonstrates how to create an event in the user's default calendar.

Listing calendars

The following example demonstrates how to retrieve details about the calendars shown in the user's calendar list.

Listing events

The following example demonstrates how to list the next 10 upcoming events in the user's default calendar.

Conditionally modifying an event

The following example shows how to conditionally update a Calendar event using the If-Match header. The script creates a new event, waits 30 seconds, then updates the event only if no event details have changed since the event was created.

Conditionally retrieving an event

The following example shows how to conditionally fetch a Calendar event using the If-None-Match header. The script creates a new event, then polls the event for changes for 30 seconds. Any time the event changes, the new version is fetched.

Synchronizing events

The following example demonstrates how to retrieve events using sync tokens. When you include a sync token in a Calendar advanced service request, the resulting response only includes items that have changed since that token was generated, enabling more efficient processing. See Synchronize Resources Efficiently for more details on the syncing process.

The following example makes use of the same getRelativeDate(daysOffset, hour) method defined in the above examples.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-04 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[[["The Advanced Calendar service in Apps Script allows you to access and modify Google Calendar data using the public Google Calendar API."],["It offers features beyond the built-in Calendar service, such as setting event background colors and using HTTP request headers for conditional updates and retrievals."],["Sample code snippets demonstrate various functionalities like creating, listing, and syncing calendar events, and conditionally modifying or retrieving specific events."],["Before using this advanced service, ensure it's enabled in your Apps Script project settings."],["Refer to the Google Calendar API reference documentation and support guide for detailed information and troubleshooting."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4