Stay organized with collections Save and categorize content based on your preferences.
Set up or update a push notification watch on the given user mailbox.
HTTP requestPOST https://gmail.googleapis.com/gmail/v1/users/{userId}/watch
The URL uses gRPC Transcoding syntax.
Path parameters ParametersuserId
string
The user's email address. The special value me
can be used to indicate the authenticated user.
The request body contains data with the following structure:
FieldslabelIds[]
string
List of labelIds to restrict notifications about. By default, if unspecified, all changes are pushed out. If specified then dictates which labels are required for a push notification to be generated.
labelFilterAction
(deprecated)
enum (
LabelFilterAction
)
Filtering behavior of labelIds list
specified. This field is deprecated because it caused incorrect behavior in some cases; use labelFilterBehavior
instead.
labelFilterBehavior
enum (
LabelFilterAction
)
Filtering behavior of labelIds list
specified. This field replaces labelFilterAction
; if set, labelFilterAction
is ignored.
topicName
string
A fully qualified Google Cloud Pub/Sub API topic name to publish the events to. This topic name must already exist in Cloud Pub/Sub and you must have already granted gmail "publish" permission on it. For example, "projects/my-project-identifier/topics/my-topic-name" (using the Cloud Pub/Sub "v1" topic naming format).
Note that the "my-project-identifier" portion must exactly match your Google developer project id (the one executing this watch request).
Response bodyPush notification watch response.
If successful, the response body contains data with the following structure:
JSON representation{ "historyId": string, "expiration": string }Fields
historyId
string
The ID of the mailbox's current history record.
expiration
string (int64 format)
When Gmail will stop sending notifications for mailbox updates (epoch millis). Call watch
again before this time to renew the watch.
Requires one of the following OAuth scopes:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.metadata
For more information, see the Authorization guide.
LabelFilterActionFiltering behavior of labelIds list specified.
Enumsinclude
Only get push notifications for message changes relating to labelIds specified. exclude
Get push notifications for all message changes except those relating to labelIds specified.
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