Watch

Set up or update a push notification watch on the given user mailbox

4 variables
2 variables

Set up or update a push notification watch on the given user mailbox

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Read, compose, send, and permanently delete all your email from Gmail
  • View your email message metadata such as labels and headers, but not the email body
  • View and modify but not delete your email
  • View your email messages and settings

Input

This building block consumes 4 input parameters

  = Parameter name
  = Format

userId STRING Required

The user's email address. The special value me can be used to indicate the authenticated user

labelFilterAction ENUMERATION

Filtering behavior of labelIds list specified

labelIds[] STRING

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)

Output

This building block provides 2 output parameters

  = Parameter name
  = Format

expiration INTEGER

When Gmail will stop sending notifications for mailbox updates (epoch millis). Call watch again before this time to renew the watch

historyId INTEGER

The ID of the mailbox's current history record