My Business
2.2K members online now
2.2K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Ensure that the topic exists and is shared with the GMB API service account

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We are trying to use the GMB API Update Notifications using pub sub.  This is the error that I am receiving when trying it through the OAuth Playground.  I know the topic name is valid, so I know it has to the the "shared.." part of the error code.  Exactly what does "shared" mean.  I have set the permissions on the topic to include the mybusiness-api-pubsub@system.gserviceaccount.com as a publisher.  Any help would be much appreciated.

 

{ "error": { "status": "INVALID_ARGUMENT", "message": "Request contains an invalid argument.", "code": 400, "details": [ { "errorDetails": [ { "message": "Invalid topic name provided for subscription. Ensure that the topic exists and is shared with the GMB API service account.", "code": 3 } ], "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError" } ] } }

 

 

 

1 Expert replyverified_user

Re: Ensure that the topic exists and is shared with the GMB API service account

Google Employee
# 2
Google Employee

Hi @Robert M,

 

Please make sure the “myproject” placeholder for the topic shown below is the Project ID of your whitelisted project. According to the Publisher Guide, a topic you create is supposed to be in this format:

 

projects/myproject/topics/mytopic

 

Please navigate to the Pub/Sub topics page in the Cloud Platform Console to make sure that you have Given it publish permissions, Created a subscription and Specified push or pull delivery flow. Please note that you can perform these aforementioned operations not only through sending requests, but also manually through the Cloud Platform Console UI.

 

Please use the correct format shown above for the topicName field of the Notifications object when sending the PUT request for updating the Google Cloud Pub/Sub notification settings for the specified account. Please note that the URI of this PUT request including the account_name of the specified account should be in this format:

 

https://mybusiness.googleapis.com/v3/accounts/account_name/notifications

 

Thanks,

The Google My Business API team

Re: Ensure that the topic exists and is shared with the GMB API service account

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

For future reference, make sure you are using the parameter "topicName", instead of "name" as is mentioned in Google's documentation.

Re: Ensure that the topic exists and is shared with the GMB API service account

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thanks Steven!

Just to back this up, this is incorrect.

https://mybusiness.googleapis.com/v3/accounts/account_name/notifications

{
  name
: your/pubsub/topicName
}

It should be:

https://mybusiness.googleapis.com/v3/accounts/account_name/notifications

{
  topicName
: your/pubsub/topicName
}

 

Ensure that the topic exists and is shared with the GMB API service account

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭