3
votes

I'm familiar with the concepts of push notification with Gmail and 'webhooks' in general. My question is - is there a way to get push notifications about all Gmail Users Emails that are related to the same Gsuite Account? I know that there is a way to get global token by Perform G Suite Domain-Wide Delegation of Authority but I can't find enough info about how to listen to all user's emails and if it's even possible.

1

1 Answers

1
votes

The Gmail API uses the Cloud Pub/Sub API to deliver push notifications. This allows notification via a variety of methods including webhooks and polling on a single subscription endpoint.

POST "https://www.googleapis.com/gmail/v1/users/me/watch"
Content-type: application/json

{
  topicName: "projects/myproject/topics/mytopic",
  labelIds: ["INBOX"],
}

Info on how to implement domain wide dedication