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

GMB API User can't see existing accounts

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm a bit confused. We were approved for GMB API access. I created an api user using the same email address in the developer console that I use to log into GMB.

 

When calling: 

accounts_response = requests.get("https://mybusiness.googleapis.com/v3/accounts?access_token={0}".format(self._credentials.access_toke...))

I get the response:

{
  "accounts": [
    {
      "name": "accounts/110REDACTED2345234",
      "type": "PERSONAL",
      "state": {
         "status": "UNVERIFIED"
      }
    }
  ]
}

But I expect to see the 3 business accounts viewable in the GMB interface. Do I just have the permissions wrong? 

 

1 Expert replyverified_user

Re: GMB API User can't see existing accounts

Google Employee
# 2
Google Employee

Hi @David Z,

 

Please make sure the account your are using has been added as an admin to the business account that you are trying to access. We suggest you read more about the best practices for using Business Accounts with Google My Business locations in the FAQ.

 

Thanks,

The Google My Business API team

GMB API User can't see existing accounts

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Dealing with two username/emails here. One I'll call blahblahblah@gmail.com and the other will be blah@blah.iam.gserviceaccount.com.

 

We've been using blahblahblah@gmail.com for years across many google services. blah@blah.iam.gserviceaccount.com was created specifically to access and administer GMB via the API. We have a GMB API project that's been approved and blah@blah.iam.gserviceaccount.com has "Owner, App Engine Admin, Organization Administrator, Service Account Admin" IAM permissions for the project.

 

 

Logging into http://business.google.com with blahblahblah@gmail.com I can see three accounts. Two of them have a label "Business account you own" and have three dots in the upper right corner. On one of them blah@blah.iam.gserviceaccount.com has the status "Invited, Manager" on the other blah@blah.iam.gserviceaccount.com has the status "Invited, Owner". The third account has "blahblahblah@gmail.com" in place of "Business account you own". This one doesn't have the 3 dots. No user management options. I don't see "admin" as an option anywhere, or in text anywhere in the link you provided.

 

Still stuck. 

GMB API User can't see existing accounts

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

hi did you get any solution?

GMB API User can't see existing accounts

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Still waiting for a response from @Shalini S

Re: GMB API User can't see existing accounts

Google Employee
# 6
Google Employee

Hi @David Z

 

A service account's generated email address is not equivalent to a Google Accounts email address. You can't sign in with your service account's email address to access the Google My Business UI. You also can’t add a service account's email address as an admin to a business account or location because when you invite someone to become an admin for an account or location, the invitee's email address should be associated with a Google Account in order to accept the invitation and become an admin.

 

For using a service account to access the Google My Business account and location data on behalf of a particular end user, you should request user consent for that end user’s Google Account only once. You can perform this process during the OAuth 2.0 installed application flow. When you prepare to make authorized API calls using the service account, you specify the user to impersonate by specifying the email address of the user’s Google Account for access to their Google My Business data.

 

I hope this helps!

 

Thanks,

The Google My Business API team

GMB API User can't see existing accounts

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Thanks @Shalini S for responding again. Even more confused now. The docs say:

 

"For these types of server-to-server interactions you need a service account, which is an account that belongs to your application instead of to an individual end-user. Your application calls Google APIs on behalf of the service account, and ****user consent is not required****". Emphasis mine. Is Google My Business an exception to this?

Re: GMB API User can't see existing accounts

Google Employee
# 8
Google Employee

Hi @David Z,

 

Yes, you need to request user consent at least once for each Google Account you need to access the Google My Business data from. The end users will have to log in with their Google Accounts to manually authorize the application using OAuth 2.0 Authorization. They need to perform this process only once with an OAuth 2.0 client ID during the OAuth 2.0 installed application flow, OAuth 2.0 web server application flow (your other OAuth 2.0 client ID web app).

 

Thanks,

The Google My Business API team