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

Managing multiple business accounts

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

Hi,

 

We are an agency and we manage many businesses GMB accounts.

In GMB Help center, it said "Agencies managing multiple businesses: Maintain separate accounts for each business you manage" (https://support.google.com/business/answer/4490296?hl=en). But for GMB API, it said one projet by company (agency).

What should we do ?

 

And if we want to create one batch application (to update data) and also create a web application to display statistics or reviews, we need to create separate projects ?

 

Thanks for your help !

Victor

1 Expert replyverified_user

Re: Managing multiple business accounts

Google Employee
# 2
Google Employee

Hi @GMB I,

 

If you are managing multiple business accounts, you don’t need a separate set of OAuth 2.0 credentials for access to your account and location data in each different Google Account. For separation of access to your Google My Business data in different Google Accounts, all you need to do is to generate and store a separate OAuth 2.0 access token for each Google Account that you use for managing locations in Google My Business.

 

For generating separate OAuth 2.0 access tokens for each Google Account, when you use your whitelisted project’s credentials to obtain an OAuth 2.0 access token for authentication via the Google My Business API, you should be logging in with your specific Google Account. When this token is provided and you are making API calls, you will be able to view and manage all the existing locations within that specific account. You should repeat this process with a single set of OAuth 2.0 credentials for your separate Google Accounts to obtain a token for each Google Account.

 

In addition, when using the OAuth 2.0 client ID for authorization, you should store the refresh token for future use and use the access token to access the API. Once the access token expires, the application should use the refresh token to obtain a new one. This way, your application will always be able to request a new access token when necessary. This process requires a user to manually authorize the application only once.

 

Thanks,

Shalini

Managing multiple business accounts

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

hi

 

I have the same problem . i have create credentials for different business account but i cant access them. when i try to access them came with this response.

 

"error": {
"code": 403,
"message": "Google My Business API has not been used in project google.com:oauth-2-playground before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=google.com... then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"errors": [
{
"message": "Google My Business API has not been used in project google.com:oauth-2-playground before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=google.com... then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}

 

can u help me with a solution.

 

Thx

 

 

 

Re: Managing multiple business accounts

Google Employee
# 4
Google Employee

Hi @Mario R,

 

The common cause for not being able to find the Google My Business API in Google Developers Console is your Google Account may not have been submitted in the access request form as an email address that will administer the Project ID.

 

We’ll reach out to you privately in a separate email thread for more details.

 

Thanks,

The Google My Business API team

Managing multiple business accounts

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Shalini,

I have two related questions:

 

1) - Most important for us

 

I think I have the same issue as Mario R and GMB I,  but am not clear on the solution. I had a first client with 63 locations, (they added me using my only Google email that is linked to the white listed GMB project). Just this week, my second client added 69 locations, also using my only email. While I can look at all the locations on the website, the location object from the API indeed only gives back 100 locations (mixed). What to do?

 

We applied and got white listed, but only ever listed one email address in the application (so one Google account) for the project. I did just add my personal email to the white listed project (this must be step 1 right ?), but when I choose my personal email to get the authorization credentials, the returned location object is empty, strangely the account object is returned, with my personal account info , and name.

 

What is the best way to get access to all locations now? And in the future, If I know I will have 5 new clients, each with 99 or 100 locations, do I need to set up 5 new Google email addresses / accounts , add those emails to our white listed project, and then contact GMB admins to further approve those accounts on the API.

 

2)

When I ask the 5 new clients to add us, do I give each client one of the 5 new email addresses? If so, I am confused how I will view the full list of locations our project manages. Is that even possible. Right now if I go to https://business.google.com/manage/#/list/todo/active, I see the 130+ locations, because I am logged into that main Google account (the one we used in the application). Am I right in saying that for each new client

we have to log into the associated Google account, and so can only  see that client locations?

 

Thank you for your help,

A

Re: Managing multiple business accounts

Google Employee
# 6
Google Employee

Hi @Alan Z,

 

Please note that the maximum page size is 100 when listing locations for the specified account via the Google My Business API. You should add the pageSize and pageToken query parameters to the GET request for listing all locations under the specified account if the total number of locations exceeds 100 for that account. Please make sure that the pageToken is set to the nextPageToken field value returned by a preceding call to list locations when there were more locations than could fit in the requested page size.

 

Please also make sure that you provide a consistent pageSize query parameter in the GET request because the pageSize determines the number of pages for your total results. Notice that the pageSize query parameter has a default value 100, a minimum value 1, and a maximum value 100.

 

I hope this helps!

 

Thanks,

Shalini, Google My Business API team

Managing multiple business accounts

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Thanks Shalini, I run the code and made it work. I can now query the locations on the next page.

 

 What was confusing is that the GMB guides everywhere say you cannot have more than 100 locations per account.

 

Here is a python example I used for others who are finding the same issues:

 

for kk in range(len(list_accounts_response['accounts'])):
    if list_accounts_response['accounts'][kk]['type'] != "BUSINESS":
        print kk, list_accounts_response['accounts'][kk]['accountName']
        list_locations_response = service.accounts().locations().list(name=list_accounts_response['accounts'][kk]['name'], pageSize = 100).execute()
        pageToken_us = list_locations_response['nextPageToken']
       
        list_locations_response2 = service.accounts().locations().list(name=list_accounts_response['accounts'][kk]['name'], pageSize = 100, pageToken = pageToken_us).execute()

 

Cheers,

A

Re: Managing multiple business accounts

Google Employee
# 8
Google Employee

Hi @Alan Z,

 

We're glad your problem is fixed. Please feel free to contact us for any Google My Business API related questions.

 

Thanks,

Shalini, Google My Business API team