Events: watch
Stay organized with collections
Save and categorize content based on your preferences.
Watch for changes to Events resources.
Request
HTTP request
POST https://www.googleapis.com/calendar/v3/calendars/
calendarId
/events/watch
Parameters
Parameter name
|
Value
|
Description
|
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
|
eventTypes
|
string
|
Event types of resources to watch. Optional. This parameter can be repeated multiple times to watch resources of different types. If unset, returns all event types.
Acceptable values are:
- "
default
": Regular events.
- "
focusTime
": Focus time events.
- "
fromGmail
": Events from Gmail.
- "
outOfOffice
": Out of office events.
- "
workingLocation
": Working location events.
|
Authorization
This request allows authorization with at least one of the following scopes:
Scope
|
https://www.googleapis.com/auth/calendar.readonly
|
https://www.googleapis.com/auth/calendar
|
https://www.googleapis.com/auth/calendar.events.readonly
|
https://www.googleapis.com/auth/calendar.events
|
For more information, see the
authentication and authorization
page.
Request body
In the request body, supply data with the following structure:
{
"id":
string
,
"token":
string
,
"type":
string
,
"address":
string
,
"params": {
"ttl":
string
}
}
Property name
|
Value
|
Description
|
Notes
|
id
|
string
|
A UUID or similar unique string that identifies this channel.
|
|
token
|
string
|
An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
|
|
type
|
string
|
The type of delivery mechanism used for this channel. Valid values are "
web_hook
" (or "
webhook
"). Both values refer to a channel where Http requests are used to deliver messages.
|
|
address
|
string
|
The address where notifications are delivered for this channel.
|
|
params
|
object
|
Additional parameters controlling delivery channel behavior. Optional.
|
|
params.
ttl
|
string
|
The time-to-live in seconds for the notification channel. Default is 604800 seconds.
|
|
Response
If successful, this method returns a response body with the following structure:
{
"kind": "api#channel",
"id":
string
,
"resourceId":
string
,
"resourceUri":
string
,
"token":
string
,
"expiration":
long
}
Property name
|
Value
|
Description
|
Notes
|
kind
|
string
|
Identifies this as a notification channel used to watch for changes to a resource, which is "
api#channel
".
|
|
id
|
string
|
A UUID or similar unique string that identifies this channel.
|
|
resourceId
|
string
|
An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
|
|
resourceUri
|
string
|
A version-specific identifier for the watched resource.
|
|
token
|
string
|
An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
|
|
expiration
|
long
|
Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
|
|
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 2024-05-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]