Using API to invite admin account?[ Edited ]
August 2016 - last edited August 2016 by Terry W
I may be grossly misunderstanding the process, but I'm trying to figure out the best way to go about inviting/accepting a new admin account with minimal interaction.
Here's what I'm trying to accomplish:
1. User signs up for my service
2. Service requests admin access to GMB with button displaying "Link Your GMB Account"
3. User clicks button, and service account now has admin access
Is this possible? Or would the user have to log into their account and do everything manually?
Thank you for your time.
Re: Using API to invite admin account?
Hi @Jon P,
According to the workflow you’ve designed, it’s possible to request user consent for access to Google My Business data in separate, specific Google Accounts via the API during step 3 when a user clicks on the button displaying "Link Your GMB Account". During step 3 of your workflow, the users should be logged in with their specific Google Accounts to manually authorize the application using OAuth 2.0 Authorization.
If you are using an OAuth 2.0 client ID, you should obtain an OAuth 2.0 access token and a refresh token for each Google Account you need to access account and location data from. You should store the refresh token for refreshing the access token once it expires and use the access token to access the API.
If you are using a service account, you should request user consent for the specified Google Account using an OAuth 2.0 client ID. When you prepare to make authorized API calls using the service account, you should specify the user to impersonate by specifying the email address of the user’s specific Google Account for access to their Google My Business data.
I suggest you read through this Accepted Solution for using a single set of OAuth 2.0 credentials for separation of access to Google My Business data in different Google Accounts. Please also read through this Accepted Solution for using a service account to access the Google My Business API.
For clarification, you can Manage Admins for Accounts and Locations via the API. However, adding users as managers to your business account or listings will only allow you to share management of your locations within your Google Account with multiple users, and not to invite other users to share their locations with you in your Google Account.
For more information about owners and managers of business accounts, please check out this article in the Google My Business Help Center.
For more information about owners and managers of listings, please check out this article in the Google My Business Help Center.