Hi everyone,
Is it possible to grant a service account the necessary permissions to access the Google Business Profile API for reading reviews? Or does this API require access through a primary user account, with the service account needing delegated access to that user account?
I’ve read conflicting information suggesting that service accounts might not have direct access and that a human user’s main account might be needed.
Any clarification would be greatly appreciated!
Thanks!
Hi @juicydisorder,
Welcome to Google Cloud Community!
To access the Google Business Profile API (GBP API) using a service account, you need to grant the service account the appropriate IAM roles:
Ask your administrator to grant you the roles/iam.serviceAccountCreator IAM role on the project.
Grant the service account the roles/resourcemanager.projectIamAdmin role to give it access to your project.
Confirm Google Business Profile is turned on
If you're using a Google workspace account, make sure Google Business Profile is turned on for your account. If it's not, you'll get an error 403 - PERMISSION DENIED when using the GBP APIs.
You can also create custom roles if there isn't a predefined role for the access level you want.
Other steps to access the GBP API include: Getting a Google Account, Trying out Business Profile, Creating a project in the Google API Console, and Requesting access to the API.
You can review the deprecation schedule and instructions to migrate from the v4 reportInsights API method to the Google Business Profile Performance API.
I hope the above information is helpful.
Hey @ruthseki and community
Thank you for your initial guidance. I’ve already created a service account and have the necessary permissions to assign roles to it. However, I’m still uncertain about which specific IAM role or configuration is required for the service account to access locations in the Google Business Profile API and retrieve reviews for these locations.
Current Setup:
The issue: I cannot retrieve the location IDs of the business locations.
My Understanding and Questions:
I need the service account to have access to the business locations so it can read the reviews for each of these locations. Any insights or detailed steps on how to achieve this would be greatly appreciated!
Apologies if these are basic questions—I’m just trying to fully understand what’s going on here and might be missing something simple. 🙈😅
Thanks in advance!
I have the same question, any luck @juicydisorder ?
Hey @juicydisorder
Have you found a solution for this yet?
I have the same question.
plus 1
We are having the same issue, I can assign access to the service account in the business.google.com portal, but it just is stuck at invited since there is no way to accept the invitation.
So a little progress is that once I have the service account setup in the project I need to add the Service Account on the BPM UI by clicking on Group Settings -> Manage Users -> Add Users as a manager, then use the accounts.invitations.list with the account_id (from accounts.list) to get the invitation. In theory at that point I can use accounts.invitations.accept with the invitation ID to accept the invite and the service account will have access, except I keep getting back "Precondition check failed (failedPrecondition)". Anyone else have thoughts on this?