PNC
PNC

Reputation: 1972

Gmail notifications issue with setIamPolicy

I am trying to get the new Gmail Push notifications working as detailed here

https://developers.google.com/gmail/api/guides/push

I have managed to get the pubsub side of it working (created topic, subscription and can publish and pull messages OK) but it fails at the step

Grant Publish Rights on your Topic

The client I am using (.Net) does not support the required methods so I am using the API explorer. Using the Explorer I generate the following Request.

POST https://pubsub.googleapis.com/v1beta2/projects/vivid-canyon-90023/topics/iLink:setIamPolicy?key={YOUR_API_KEY}

{
 "policy": {
  "bindings": [
   {
    "role": "roles/pubsub.publisher",
    "members": [
     "serviceAccount:[email protected]"
    ]
   }
  ]
 }
}

Which yields a response Error of

{
 "error": {
  "code": 500,
  "message": "Internal error encountered.",
  "status": "INTERNAL"
 }
}

Not sure what the issue is - has anybody had success with setting Publish Rights as prescribed?

Upvotes: 4

Views: 589

Answers (2)

Takashi Matsuo
Takashi Matsuo

Reputation: 3436

Entirely updated:

I confirmed that calls fail from Asia, while the same calls succeed from U.S. datacenters. We will work on the fix on Monday (June 1, 2015).

We have rolled out the fix for this, and it should work just fine now (9:00AM Pacific June 1, 2015).

Sorry for the trouble.

Upvotes: 1

Eric D
Eric D

Reputation: 7159

Your role looks wrong, it should be "roles/pubsub.publisher" (missing the "pubsub.") as per the docs there: https://developers.google.com/gmail/api/guides/push#pubsub_setup

Upvotes: 0

Related Questions