Gmail.users.watch Fails To Send Test Message To PubSub With A DwD Service Account
I'm trying to setup gmail.users.watch but am getting a 403 error: Error sending test message to Cloud PubSub projects/project-id/topics/topic-id : User not authorized to perform th
Solution 1:
You need to add permissions so messages can be publish to your subscription.
Go to Google Cloud console, select the subscription and then Permissions. In the Add members section, type allAuthenticatedUsers, select the Pub/Sub publisher role and click Add
Does it help?
Update (2017/05/09):
I'm editing my answer in order to be more accurate about what's needed.
According to the Gmail API documentation (see the Grant publish rights on your topic section):
- the permission needs to be set at the topic level
- the member is: serviceAccount:gmail-api-push@system.gserviceaccount.com
- the role is: Pub/Sub Publisher
Post a Comment for "Gmail.users.watch Fails To Send Test Message To PubSub With A DwD Service Account"