Google takvim


Server Error – Google Calendar – Google Calendar

Google Calendar is temporarily unavailable. Please try back later. In the meanwhile, you might find useful information on our Help Center and Help Forum. We apologize for any inconvenience.

Google カレンダーは一時的にご利用いただけません。 しばらくしてから、もう一度試してみてください。 また、ヘルプ センターおよびヘルプ グループ (英語) でも、問題の解決に役立つ情報を提供しております。 ご不便をおかけしますが何卒ご了承ください。

Google Agenda est momentanément indisponible. Veuillez réessayer ultérieurement. En attendant, vous trouverez des informations utiles dans notre Centre d’aide et notre Forum d’aide. Nous vous prions de nous excuser des désagréments occasionnés.

Der Google Kalender-Service ist vorübergehend nicht verfügbar. Versuchen Sie es später erneut. In der Zwischenzeit erhalten Sie nützliche Informationen in der Google Kalender-Hilfe und der Google Kalender-Hilfegruppe (nur auf Englisch verfügbar). Wir entschuldigen uns für eventuelle Unannehmlichkeiten.

Google Calendar no estará disponible temporalmente. Por favor, intenta acceder más tarde. Mientras tanto, puedes consultar el Centro de Asistencia y el Grupo de Ayuda (sólo en inglés), donde encontrarás información interesante. Disculpa las molestias.

Google Agenda is tijdelijk niet beschikbaar. Probeer het later nogmaals. In de tussentijd kun je nuttige informatie vinden in ons Helpcentrum en de discussiegroep (alleen in het Engels). Onze excuses voor het ongemak.

Google Calendar non è temporaneamente disponibile. Riprova più tardi. Nel frattempo prova a consultare il nostro Centro assistenza e il Gruppo di assistenza (solo in inglese) per trovare informazioni utili. Ci scusiamo per gli eventuali disagi causati.

O Google Agenda não está disponível no momento. Tente novamente mais tarde. Enquanto isso, você pode encontrar informações úteis na nossa Central de Ajuda e no Grupo de ajuda (apenas em inglês). Pedimos desculpas por qualquer inconveniente.

Google 日曆暫時無法使用。 請稍後再試。 在此期間,您可以在我們的說明中心和協助團隊 (僅英文) 中找到有用的資訊。對於造成您的任何不便,我們謹此致歉。

Google 日历暂时不可用。请稍后再试。在此期间,您可以在我们的支持中心和支持论坛(仅有英文版)查找有用的信息。对于由此带来的任何不便,我们深表歉意。

Kalendarz Google jest tymczasowo niedostępny. Spróbuj ponownie później. Tymczasem możesz znaleźć przydatne informacje w naszym Centrum pomocy i grupie dyskusyjnej pomocy (tylko w języku angielskim). Przepraszamy za wszelkie niedogodności.

Google Kalender är inte tillgängligt för tillfället. Försök igen senare. Under tiden kan du hitta användbar information i vårt hjälpcenter och i vår hjälpgrupp (endast engelska). Vi ber om ursäkt för eventuellt besvär.

Google Kalender er midlertidigt ikke tilgængelig. Prøv igen senere. I mellemtiden kan du muligvis finde brugbare oplysninger i vores Hjælp og Hjælpegruppe (kun på engelsk). Vi beklager ulejligheden.

Google 캘린더를 잠시 사용할 수 없습니다. 나중에 다시 열어보십시오. 궁금한 점이 있으면 우선 Google 도움말 센터 및 도움말 그룹(영어만 지원)에서 찾아보십시오. 불편을 끼쳐드려 죄송합니다.

Календарь Google временно недоступен. Повторите попытку позже. А пока полезную информацию можно найти в нашем справочном центре и группе обсуждения (только на английском языке). Приносим извинения за причиненные неудобства.

Google Kalender er midlertidig utilgjengelig. Prøv igjen senere. I mellomtiden kan du finne nyttig informasjon i Brukerstøtten og hos Hjelpegruppen (bare på engelsk). Vi beklager eventuelle ulemper dette medfører.

Google-kalenteri on väliaikaisesti poissa käytöstä. Yritä myöhemmin uudelleen. Voit löytää hyödyllisiä tietoja ohjekeskuksestamme ja keskusteluryhmästämme (vain englanniksi). Pahoittelemme tilanteesta mahdollisesti aiheutuvaa haittaa.

Google Takvim geçici olarak kullanım dışıdır. Lütfen daha sonra tekrar deneyin. Bu arada, Yardım Merkezimizde ve Yardım Grubunda (yalnızca İngilizce) yararlı bilgiler bulabilirsiniz. Bu durum için özür dileriz.

www.google.com

Events  |  Google Calendar API  |  Google Developers

anyoneCanAddSelf boolean Whether anyone can invite themselves to the event (currently works for Google+ events only). Optional. The default is False. writable attachments[] list File attachments for the event. Currently only Google Drive attachments are supported.

In order to modify attachments the supportsAttachments request parameter should be set to true.

There can be at most 25 attachments per event,

attachments[].fileId string ID of the attached file. Read-only.

For Google Drive files, this is the ID of the corresponding Files resource entry in the Drive API.

attachments[].fileUrl string URL link to the attachment.

For adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API.

attachments[].iconLink string URL link to the attachment's icon. Read-only. attachments[].mimeType string Internet media type (MIME type) of the attachment. attachments[].title string Attachment title. attendeesOmitted boolean Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the maxAttendee query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False. writable attendees[] list The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users. writable attendees[].additionalGuests integer Number of additional guests. Optional. The default is 0. writable attendees[].displayName string The attendee's name, if available. Optional. writable attendees[].email string The attendee's email address, if available. This field must be present when adding an attendee. It must be a valid email address as per RFC5322. attendees[].id string The attendee's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API attendees[].optional boolean Whether this is an optional attendee. Optional. The default is False. writable attendees[].organizer boolean Whether the attendee is the organizer of the event. Read-only. The default is False. attendees[].resource boolean Whether the attendee is a resource. Read-only. The default is False. attendees[].responseStatus string The attendee's response status. Possible values are:
  • "needsAction" - The attendee has not responded to the invitation.
  • "declined" - The attendee has declined the invitation.
  • "tentative" - The attendee has tentatively accepted the invitation.
  • "accepted" - The attendee has accepted the invitation.
writable attendees[].self boolean Whether this entry represents the calendar on which this copy of the event appears. Read-only. The default is False. colorId string The color of the event. This is an ID referring to an entry in the event section of the colors definition (see the colors endpoint). Optional. writable created datetime Creation time of the event (as a RFC3339 timestamp). Read-only. creator object The creator of the event. Read-only. creator.displayName string The creator's name, if available. creator.email string The creator's email address, if available. creator.id string The creator's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API creator.self boolean Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. description string Description of the event. Optional. writable end nested object The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance. end.date date The date, in the format "yyyy-mm-dd", if this is an all-day event. writable end.dateTime datetime The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone. writable end.timeZone string The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end. writable endTimeUnspecified boolean Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. The default is False. etag etag ETag of the resource. extendedProperties object Extended properties of the event. extendedProperties.private object Properties that are private to the copy of the event that appears on this calendar. writable extendedProperties.private.(key) string The name of the private property and the corresponding value. extendedProperties.shared object Properties that are shared between copies of the event on other attendees' calendars. writable extendedProperties.shared.(key) string The name of the shared property and the corresponding value. gadget object A gadget that extends this event. gadget.display string The gadget's display mode. Optional. Possible values are:
  • "icon" - The gadget displays next to the event's title in the calendar view.
  • "chip" - The gadget displays when the event is clicked.
writable gadget.height integer The gadget's height in pixels. The height must be an integer greater than 0. Optional. writable gadget.iconLink string The gadget's icon URL. The URL scheme must be HTTPS. writable gadget.link string The gadget's URL. The URL scheme must be HTTPS. writable gadget.preferences object Preferences. writable gadget.preferences.(key) string The preference name and corresponding value. gadget.title string The gadget's title. writable gadget.type string The gadget's type. writable gadget.width integer The gadget's width in pixels. The width must be an integer greater than 0. Optional. writable guestsCanInviteOthers boolean Whether attendees other than the organizer can invite others to the event. Optional. The default is True. writable guestsCanSeeOtherGuests boolean Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True. writable hangoutLink string An absolute link to the Google+ hangout associated with this event. Read-only. htmlLink string An absolute link to this event in the Google Calendar Web UI. Read-only. iCalUID string Event unique identifier as defined in RFC5545. It is used to uniquely identify events accross calendaring systems and must be supplied when importing events via the import method.

Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs.

id string Opaque identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules:
  • characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938
  • the length of the ID must be between 5 and 1024 characters
  • the ID must be unique per calendar
Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122.

If you do not specify an ID, it will be automatically generated by the server.

Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs.

writable kind string Type of the resource ("calendar#event"). location string Geographic location of the event as free-form text. Optional. writable locked boolean Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or "recurrence". The default is False. Read-Only. organizer object The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. writable organizer.displayName string The organizer's name, if available. writable organizer.email string The organizer's email address, if available. It must be a valid email address as per RFC5322. writable organizer.id string The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API organizer.self boolean Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. originalStartTime nested object For an instance of a recurring event, this is the time at which this event would start according to the recurrence data in the recurring event identified by recurringEventId. Immutable. originalStartTime.date date The date, in the format "yyyy-mm-dd", if this is an all-day event. writable originalStartTime.dateTime datetime The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone. writable originalStartTime.timeZone string The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end. writable privateCopy boolean Whether this is a private event copy where changes are not shared with other copies on other calendars. Optional. Immutable. The default is False. recurrence[] list List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this field; event start and end times are specified in the start and end fields. This field is omitted for single events or instances of recurring events. writable recurringEventId string For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. reminders object Information about the event's reminders for the authenticated user. reminders.overrides[] list If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for this event. The maximum number of override reminders is 5. writable reminders.overrides[].method string The method used by this reminder. Possible values are:
  • "email" - Reminders are sent via email.
  • "sms" - Reminders are sent via SMS. These are only available for G Suite customers. Requests to set SMS reminders for other account types are ignored.
  • "popup" - Reminders are sent via a UI popup.
reminders.overrides[].minutes integer Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). reminders.useDefault boolean Whether the default reminders of the calendar apply to the event. writable sequence integer Sequence number as per iCalendar. writable source object Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. Can only be seen or modified by the creator of the event. source.title string Title of the source; for example a title of a web page or an email subject. writable source.url string URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS. writable start nested object The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance. start.date date The date, in the format "yyyy-mm-dd", if this is an all-day event. writable start.dateTime datetime The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone. writable start.timeZone string The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end. writable status string Status of the event. Optional. Possible values are:
  • "confirmed" - The event is confirmed. This is the default status.
  • "tentative" - The event is tentatively confirmed.
  • "cancelled" - The event is cancelled.
writable summary string Title of the event. writable transparency string Whether the event blocks time on the calendar. Optional. Possible values are:
  • "opaque" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI.
  • "transparent" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI.
writable updated datetime Last modification time of the event (as a RFC3339 timestamp). Read-only. visibility string Visibility of the event. Optional. Possible values are:
  • "default" - Uses the default visibility for events on the calendar. This is the default value.
  • "public" - The event is public and event details are visible to all readers of the calendar.
  • "private" - The event is private and only event attendees may view event details.
  • "confidential" - The event is private. This value is provided for compatibility reasons.
writable

developers.google.com

Reminders and Notifications  |  Google Calendar API  |  Google Developers

The Calendar API provides support for reminders and notifications.

  • Reminders are alarms triggered at a specified time before an event starts.
  • Notifications allow users to find out about changes to events in their calendar.

The last item should be not confused with push notifications which, instead of being delivered to a user, notify another server of changes to a calendar.

Reminders

A reminder consists of:

  • When to show the reminder, expressed as minutes before the event start time
  • The delivery method to use (see Delivery mechanisms)

Reminders can be specified for whole calendars and for individual events. Users can set default reminders for each of their calendars; these defaults apply to all events within that calendar. However, users can also override these defaults for individual events, replacing them with a different set of reminders.

Default reminders

Reminders are private information, specific to an authenticated user; they are not shared across multiple users. As a result:

  • Default reminders are manipulated through the CalendarList collection, which contains user-specific calendar metadata
  • They are not accessible via the Calendars collection, which contains global metadata shared across all users.

Default reminders are also returned when doing an Events list query.

Overriding default reminders

To override the default reminders when you insert of modify an event, set reminders.useDefault to false and populate reminders.overrides with the new reminder set.

"reminders": { "useDefault": "useDefault", # Overrides can be set if and only if useDefault is false. "overrides": [ { "method": "reminderMethod", "minutes": "reminderMinutes" }, # ... ] }

To revert back to the default set of reminders, perform an update setting reminders.useDefault back to true.

Notifications

Calendar support the following notification types:

  • Event creation: a new event has been added to one of the user's calendars.
  • Event change: an event the user is invited to has been modified by the organizer.
  • Event cancellation: an event the user was invited to has been cancelled.
  • Attendee response: an attendee to an event created by the user has changed their response status.
  • Agenda: a list of all the events in the user’s calendar, sent at the start of the day.

The user can decide what notifications to enable per calendar and the delivery method for each notification type. These settings are not shared with other users. Similar to default reminders, they’re accessible through the CalendarList collection.

To send email notifications to attendees for events that were inserted or updated via the API, set the sendNotifications parameter in the insert/update request to true.

Note: For attendees with non-Google email addresses, these notification emails are the only way they can find out about the event: it won't be added to their calendars automatically.

Delivery mechanisms

The delivery methods offered by Google Calendar are:

  • Pop-up. These are supported on mobile platforms and on web clients.
  • Email sent by the server.
  • SMS. These are only available for Google Apps for Work, Education, and Government customers.

The following table shows the supported methods for each reminder or notification type:

Pop-up Email SMS
Reminders Default reminders
Override reminders
Notifications Event creation
Event change
Event cancellation
Attendee response
Agenda

developers.google.com

Calendar Service  |  Apps Script  |  Google Developers

MethodReturn typeBrief description addEmailReminder(minutesBefore)CalendarEventAdds a new email reminder to the event. addGuest(email)CalendarEventAdds a guest to the event. addPopupReminder(minutesBefore)CalendarEventAdds a new popup reminder to the event. addSmsReminder(minutesBefore)CalendarEventAdds a new SMS reminder to the event. anyoneCanAddSelf()BooleanDetermines whether anyone can invite themselves. deleteEvent()voidDeletes the event. deleteTag(key)CalendarEventDeletes a key/value tag from the event. getAllDayEndDate()DateGets the date on which this all-day calendar event ends. getAllDayStartDate()DateGets the date on which this all-day calendar event begins. getAllTagKeys()String[]Gets all keys for tags that have been set on the event. getColor()StringReturns the color of the calendar event. getCreators()String[]Gets the creators of the event. getDateCreated()DateGets the date the event was created. getDescription()StringGets the description of the event. getEmailReminders()Integer[]Gets the minute values for all email reminders for the event. getEndTime()DateGets the date and time at which this calendar event ends. getEventSeries()CalendarEventSeriesGets the series of recurring events that this event belongs to. getGuestByEmail(email)EventGuestGets a guest by email address. getGuestList()EventGuest[]Gets the guests for the event, not including the event owner. getGuestList(includeOwner)EventGuest[]Gets the guests for the event, potentially including the event owners. getId()StringGets the ID of the event. getLastUpdated()DateGets the date the event was last updated. getLocation()StringGets the location of the event. getMyStatus()GuestStatusGets the event status (attending, etc.) of the effective user. getOriginalCalendarId()StringGet the ID of the calendar where this event was originally created. getPopupReminders()Integer[]Gets the minute values for all popup reminders for the event. getSmsReminders()Integer[]Gets the minute values for all SMS reminders for the event. getStartTime()DateGets the date and time at which this calendar event begins. getTag(key)StringGets a tag value of the event. getTitle()StringGets the title of the event. getVisibility()VisibilityGets the visibility of the event. guestsCanInviteOthers()BooleanDetermines whether guests can invite other guests. guestsCanModify()BooleanDetermines whether guests can modify the event. guestsCanSeeGuests()BooleanDetermines whether guests can see other guests. isAllDayEvent()BooleanDetermines whether this is an all-day event. isOwnedByMe()BooleanDetermines whether the event is owned by the effective user. isRecurringEvent()BooleanDetermines whether the event is part of an event series. removeAllReminders()CalendarEventRemoves all reminders from the event. removeGuest(email)CalendarEventRemoves a guest from the event. resetRemindersToDefault()CalendarEventResets the reminders using the calendar's default settings. setAllDayDate(date)CalendarEventSets the date of the event. setAllDayDates(startDate, endDate)CalendarEventSets the dates of the event. setAnyoneCanAddSelf(anyoneCanAddSelf)CalendarEventSets whether non-guests can add themselves to the event. setColor(color)CalendarEventSets the color of the calendar event. setDescription(description)CalendarEventSets the description of the event. setGuestsCanInviteOthers(guestsCanInviteOthers)CalendarEventSets whether guests can invite other guests. setGuestsCanModify(guestsCanModify)CalendarEventSets whether guests can modify the event. setGuestsCanSeeGuests(guestsCanSeeGuests)CalendarEventSets whether guests can see other guests. setLocation(location)CalendarEventSets the location of the event. setMyStatus(status)CalendarEventSets the event status (attending, etc.) of the effective user. setTag(key, value)CalendarEventSets a key/value tag on the event, for storing custom metadata. setTime(startTime, endTime)CalendarEventSets the dates and times for the start and end of the event. setTitle(title)CalendarEventSets the title of the event. setVisibility(visibility)CalendarEventSets the visibility of the event.

developers.google.com

CalDAV API Developer's Guide  |  Google CalDAV API  |  Google Developers

CalDAV is an extension of WebDAV that provides a standard for clients to access calendar information on a remote server.

Google provides a CalDAV interface that you can use to view and manage calendars using the CalDAV protocol.

Specifications

For each of the relevant specifications, Google's CalDAV support is as follows:

  • rfc4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)
    • Supports the HTTP methods GET, PUT, HEAD, DELETE, POST, OPTIONS, PROPFIND and PROPPATCH.
    • Does not support the HTTP methods LOCK, UNLOCK, COPY, MOVE, or MKCOL, or the If* header (except for If-Match).
    • Does not support arbitrary (user-defined) WebDAV properties.
    • Does not support WebDAV Access Control (rfc3744).
  • rfc4791: Calendaring Extensions to WebDAV (CalDAV)
    • Supports the HTTP method REPORT. All reports except free-busy-query are implemented.
    • Does not support the HTTP method MKCALENDAR.
  • rfc5545: iCalendar
    • Data exposed in the CalDAV interface are formatted according to the iCalendar specification.
    • Does not currently support VTODO or VJOURNAL data.
  • rfc6638: Scheduling Extensions to CalDAV
    • Supports a trivial "inbox," which is always empty.
    • Invitations you receive are automatically delivered into your "events" collection rather than being placed into your "inbox."
    • Does not support free-busy lookup.
  • caldav-ctag-02: Calendar Collection Entity Tag (CTag) in CalDAV
    • The calendar ctag is like a resource etag; it changes when anything in the calendar has changed. This allows the client application to quickly determine that it does not need to synchronize any changed events.

We have not yet provided a full implementation of all of the relevant specifications, however for many clients such as Apple iCal™ the CalDAV protocol should interoperate correctly.

Note: For account security and to prevent abuse, Google might set cookies on client applications that access data via CalDAV.

Creating your client ID

To use the CalDAV API you need to have a Google Account. If you already have an account you can use, then you're all set.

Before you can send requests to the CalDAV API, you must register your client with the Google Developers Console by creating a project.

Go to the Google Developers Console. Click Create Project, enter a name, and click Create.

The next step is to activate CalDAV API.

To activate an API for your project, do the following:

  1. Open the API Library in the Google Developers Console. If prompted, select a project or create a new one. The API Library lists all available APIs, grouped by product family and popularity.
  2. If the API you want to activate isn't visible in the list, use search to find it.
  3. Select the API you want to activate, then select the Enable API button.

After you have enabled an API, use the Enabled APIs link in the Console's API section to see a list of all your enabled APIs. From the list, you can disable and re-enable an API. Some APIs prompt you to accept their Terms of Service before you can activate them.

To perform CalDAV API requests you will need Client ID and Client Secret.

To find your project's client ID and client secret, do the following:

  1. Select an existing OAuth 2.0 credential or open the Credentials page.
  2. If you haven't done so already, create your project's OAuth 2.0 credentials by clicking Add credentials > OAuth 2.0 client ID, and providing the information needed to create the credentials.
  3. Look for the Client ID in the OAuth 2.0 client IDs section. You can click the client ID for details.

Connecting to Google's CalDAV server

To use the CalDAV interface, a client program initially connects with the calendar server at one of two starting points. In either case, the connection must be made over HTTPS and must use the OAuth 2.0 authentication scheme. The CalDAV server will refuse to authenticate a request unless it arrives over HTTPS with OAuth 2.0 authentication of a Google account. Attempting to connect over HTTP or using Basic Authentication results in an HTTP 401 Unauthorized status code.

If the client program (such as Apple iCal™) requires a principal collection as the starting point, the URI to connect to is:

https://apidata.googleusercontent.com/caldav/v2/calid/user

Where calid should be replaced by the "calendar ID" of the calendar to be accessed. This can be found through the Google Calendar web interface as follows: in the pull-down menu next to the calendar name, select Calendar Settings. On the resulting page the calendar ID is shown in a section labelled Calendar Address. The calendar ID for a user's primary calendar is the same as that user's email address.

If a client program (such as Mozilla Sunbird) requires a calendar collection as the starting point, the URI to connect to is:

https://apidata.googleusercontent.com/caldav/v2/calid/events

The old endpoint https://www.google.com/calendar/dav is deprecated and no longer supported; use it at your own risk. We recommend you transition to the new endpoint format described above.

developers.google.com

list  |  Google Calendar API  |  Google Developers

Path parameters calendarId string Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. Optional query parameters alwaysIncludeEmail boolean Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. iCalUID string Specifies event ID in the iCalendar format to be included in the response. Optional. maxAttendees integer The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. maxResults integer Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. orderBy string The order of the events returned in the result. Optional. The default is an unspecified, stable order.

Acceptable values are:

  • "startTime": Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)
  • "updated": Order by last modification time (ascending).
pageToken string Token specifying which result page to return. Optional. privateExtendedProperty string Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. q string Free text search terms to find events that match these terms in any field, except for extended properties. Optional. sharedExtendedProperty string Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. showDeleted boolean Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. showHiddenInvitations boolean Whether to include hidden invitations in the result. Optional. The default is False. singleEvents boolean Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. syncToken string Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.

These are:

  • iCalUID
  • orderBy
  • privateExtendedProperty
  • q
  • sharedExtendedProperty
  • timeMin
  • timeMax
  • updatedMin
If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization.Optional. The default is to return all entries. timeMax datetime Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. timeMin datetime Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. timeZone string Time zone used in the response. Optional. The default is the time zone of the calendar. updatedMin datetime Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time.

developers.google.com

Push Notifications  |  Google Calendar API  |  Google Developers

This document describes how to use push notifications that inform your application when a resource changes.

Overview

The Google Calendar API provides push notifications that let you watch for changes to resources. You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Whenever a watched resource changes, the Google Calendar API notifies your application.

To use push notifications, you need to do three things:

  • Register the domain of your receiving URL.

    For example, if you plan to use https://mydomain.com/notifications as your receiving URL, you need to register https://mydomain.com.

  • Set up your receiving URL, or "Webhook" callback receiver.

    This is an HTTPS server that handles the API notification messages that are triggered when a resource changes.

  • Set up a notification channel for each resource endpoint you want to watch.

    A channel specifies routing information for notification messages. As part of the channel setup, you identify the specific URL where you want to receive notifications. Whenever a channel's resource changes, the Google Calendar API sends a notification message as a POST request to that URL.

Currently, the Google Calendar API supports notifications for changes to the Acl, CalendarList, Events, and Settings resources.

Registering your domain

Before you can set up a push notification channel, you must register the domain for any URLs you plan to use to receive push notification messages. In addition, before you register a domain, you must first verify that you own it. This step is an abuse-prevention measure to stop anyone from using push to send messages to someone else’s domain.

Step 1: Verify that you own the domain

Before you can register your domain, you need to verify that you own it. Complete the site verification process using Search Console. For more details, see the site verification help documentation.

Step 2: Register your domain

To register a verified domain name as one of the allowed domains for your project, do the following:

  1. Go to the Domain verification page in the API Console.
  2. Click Add domain.
  3. Fill in the form, then again click Add domain.

At this point, the Google API Console checks all domains in the list against the ones that you have verified in Search Console. Assuming that you properly verified all the domains, the page updates to show your new list of allowed domains. You now can use any of these domains to receive push notifications.

Creating notification channels

To request push notifications, you need to set up a notification channel for each resource you want to watch. After your notification channels are set up, the Google Calendar API will inform your application when any watched resource changes.

Making watch requests

Each watchable Google Calendar API resource has an associated watch method at a URI of the following form:

https://www.googleapis.com/apiName/apiVersion/resourcePath/watch

To set up a notification channel for messages about changes to a particular resource, send a POST request to the watch method for the resource.

Each notification channel is associated both with a particular user and a particular resource (or set of resources). A watch request will not be successful unless the current user owns or has permission to access this resource.

Example

Start watching for changes to a collection of events on a given calendar:

POST https://www.googleapis.com/calendar/v3/calendars/[email protected]/events/watch Authorization: Bearer auth_token_for_current_user Content-Type: application/json { "id": "01234567-89ab-cdef-0123456789ab", // Your channel ID. "type": "web_hook", "address": "https://mydomain.com/notifications", // Your receiving URL. ... "token": "target=myApp-myCalendarChannelDest", // (Optional) Your channel token. "expiration": 1426325213000 // (Optional) Your requested channel expiration time. } }
Required properties

With each watch request, you need to provide:

  • An id property string that uniquely identifies this new notification channel within your project. We recommend that you use a universally unique identifier (UUID) or any similar unique string. Maximum length: 64 characters.

    The ID value you set is echoed back in the X-Goog-Channel-Id HTTP header of every notification message that you receive for this channel.

  • A type property string set to the value web_hook.

  • An address property string set to the URL that listens and responds to notifications for this notification channel. This is your Webhook callback URL, and it must use HTTPS.

    Note that the Google Calendar API will be able to send notifications to this HTTPS address only if there is a valid SSL certificate installed on your web server. Invalid certificates include:

    • Self-signed certificates.
    • Certificates signed by an untrusted source.
    • Certificates that have been revoked.
    • Certificates that have a subject that doesn't match the target hostname.
  • Important: Before you can use a particular URL as the address value, you must first register its domain in the Google API Console.
Optional properties

You can also specify these optional fields with your watch request:

  • A token property that specifies an arbitrary string value to use as a channel token. You can use notification channel tokens for any of a variety of purposes. For example, you can use the token to verify that each incoming message is for a channel that your application created—to ensure that the notification is not being spoofed—or to route the message to the right destination within your application based on the purpose of this channel. Maximum length: 256 characters.

    The token is included in the X-Goog-Channel-Token HTTP header in every notification message that your application receives for this channel.

    If you use notification channel tokens, we recommend that you:

    • Use an extensible encoding format, such as URL query parameters. Example: forwardTo=hr&createdBy=mobile

    • Do not include sensitive data such as OAuth tokens.

    Note: If you do need to send highly sensitive data, make sure it is encrypted before adding it to the token.
  • An expiration property string set to a Unix timestamp (in ms) of the date and time when you want the Google Calendar API to stop sending messages for this notification channel.

    If a channel has an expiration time, it is included as the value of the X-Goog-Channel-Expiration HTTP header (this time in human-readable format) in every notification message that your application receives for this channel.

For more details on the request, refer to the watch method for the Acl, CalendarList, Events, and Settings resources in the API Reference.

Watch response

If the watch request successfully creates a notification channel, it returns an HTTP 200 OK status code.

The message body of the watch response provides information about the notification channel you just created, as shown in the example below.

{ "kind": "api#channel", "id": "01234567-89ab-cdef-0123456789ab"", // ID you specified for this channel. "resourceId": "o3hgv1538sdjfh", // ID of the watched resource. "resourceUri": "https://www.googleapis.com/calendar/v3/calendars/[email protected]/events", // Version-specific ID of the watched resource. "token": "target=myApp-myCalendarChannelDest", // Present only if one was provided. "expiration": 1426325213000, // Actual expiration time as Unix timestamp (in ms), if applicable. }

In addition to the properties you sent as part of your request, the returned information also includes the resourceId and resourceUri to identify the resource being watched on this notification channel.

Note: The resourceId property is a stable, version-independent identifier for the resource. The resourceUri property is the canonical URI of the watched resource in the context of the current API version, so it’s version-specific.

You can pass the returned information to other notification channel operations, such as when you want to stop receiving notifications.

For more details on the response, refer to the watch method for the Acl, CalendarList, Events, and Settings resources in the API Reference.

Sync message

After creating a new notification channel to watch a resource, the Google Calendar API sends a sync message to indicate that notifications are starting. The X-Goog-Resource-State HTTP header value for these messages is sync. Because of network timing issues, it is possible to receive the sync message even before you receive the watch method response.

It is safe to ignore the sync notification, but you can also make use of it. For example, if you decide you do not want to keep the channel, you can use the X-Goog-Channel-ID and X-Goog-Resource-ID values in a call to stop receiving notifications. You can also use the sync notification to do some initialization to prepare for later events.

The format of sync messages the Google Calendar API sends to your receiving URL is shown below.

POST https://mydomain.com/notifications // Your receiving URL. X-Goog-Channel-ID: channel-ID-value X-Goog-Channel-Token: channel-token-value X-Goog-Channel-Expiration: expiration-date-and-time // In human-readable format; present only if channel expires. X-Goog-Resource-ID: identifier-for-the-watched-resource X-Goog-Resource-URI: version-specific-URI-of-the-watched-resource X-Goog-Resource-State: sync X-Goog-Message-Number: 1

Sync messages always have an X-Goog-Message-Number HTTP header value of 1. Each subsequent notification for this channel will have a message number that is larger than the previous one, though the message numbers will not be sequential.

Renewing notification channels

A notification channel can have an expiration time, with a value determined either by your request or by any Google Calendar API internal limits or defaults (the more restrictive value is used). The channel's expiration time, if it has one, is included as a Unix timestamp (in ms) in the information returned by the watch method. In addition, the expiration date and time is included (in human-readable format) in every notification message your application receives for this channel in the X-Goog-Channel-Expiration HTTP header.

Currently there is no automatic way to renew a notification channel. When a channel is close to its expiration, you must create a new one by calling the watch method. As always, you must use a unique value for the id property of the new channel. Note that there is likely to be an "overlap" period of time when the two notification channels for the same resource are active.

Receiving notifications

Whenever a watched resource changes, your application will receive a notification message describing the change. The Google Calendar API sends these messages as HTTPS POST requests to the URL you specified as the "address" for this notification channel.

Note: These notification delivery HTTPS requests specify a user agent of APIs-Google and respect robots.txt directives, as described in APIs Google User Agent.

Understanding the notification message format

All notification messages include a set of HTTP headers that have X-Goog- prefixes. Some types of notifications can also include a message body.

Notification messages posted by the Google Calendar API to your receiving URL do not include a message body.

Examples

Change notification message for modified collection of events:

POST https://mydomain.com/notifications // Your receiving URL. Content-Type: application/json; utf-8 Content-Length: 0 X-Goog-Channel-ID: 4ba78bf0-6a47-11e2-bcfd-0800200c9a66 X-Goog-Channel-Token: 398348u3tu83ut8uu38 X-Goog-Channel-Expiration: Tue, 19 Nov 2013 01:13:52 GMT X-Goog-Resource-ID: ret08u3rv24htgh389g X-Goog-Resource-URI: https://www.googleapis.com/calendar/v3/calendars/[email protected]/events X-Goog-Resource-State: exists X-Goog-Message-Number: 10

Responding to notifications

To indicate success, you can return any of the following status codes: 200, 201, 202, 204, or 102. If your service returns 500, 502, 503, or 504, the Google Calendar API will retry with exponential backoff.

Every other return status code is considered to be a message failure and the Google Calendar API will not retry this particular notification.

Understanding Google Calendar API notification events

This section provides details on the notification messages you can receive when using push notifications with the Google Calendar API.

X-Goog-Resource-State Applies to Delivered when
sync ACLs, Calendar lists, Events, Settings. A new channel was successfully created. You can expect to start receiving notifications for it.
exists ACLs, Calendar lists, Events, Settings. There was a change to a resource. Possible changes include the creation of a new resource, or the modification or deletion of an existing resource.

Stopping notifications

The expiration time is when the notifications stop automatically. You can choose to stop receiving notifications for a particular channel before it expires by calling the stop method at the following URI:

https://www.googleapis.com/calendar/v3/channels/stop

This method requires that you provide at least the channel’s id and the resourceId properties, as shown in the example below. Note that even if the Google Calendar API has several types of resources that have watch methods, there is only one stop method.

Only users with the right permission can stop a channel. In particular:

  • If the channel was created by a regular user account, only the same user from the same client (as identifed by the OAuth 2.0 client IDs from the auth tokens) who created the channel can stop the channel.
  • If the channel was created by a service account, any users from the same client can stop the channel.
POST https://www.googleapis.com/calendar/v3/channels/stop Authorization: Bearer {auth_token_for_current_user} Content-Type: application/json { "id": "4ba78bf0-6a47-11e2-bcfd-0800200c9a66", "resourceId": "ret08u3rv24htgh389g" }
Special Considerations

When working with push notifications, keep the following in mind:

Events and ACLs are per-calendar If you want to get notified about all event or ACL changes for calendars A and B, you need to separately subscribe to the events/ACL collections for A and for B.

Settings and calendar lists are per-user Settings and calendar lists only have one collection per user, so you can subscribe just once.

Also, you won’t be notified when you gain access to a new collection (for example, a new calendar) although you will be notified if that calendar is added to the calendar list (assuming you are subscribed to the calendar list collection).

Notifications are not 100% reliable. Expect a small percentage of messages to get dropped under normal working conditions. Make sure to handle these missing messages gracefully, so that the application still syncs even if no push messages are received.

developers.google.com


Смотрите также