4
votes

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?

2
Why does .NET not support the required method? Hmm, it's possible it's slow getting generated (it's been > 12h now). Maybe ping the folks that maintain the Google APIs libraries for .NET.Eric D
There is no support for the Gmail Watch Requests either with the latest .Net Gmail API.PNC
Seems like the publishing of .NET client libraries to NuGet is slow/delayed. Will enquire.Eric D
That would be good as I think there will be a few others scratching their head without them.PNC
New APIs are out now on Nuget.PNC

2 Answers

1
votes

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.

0
votes

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