4

The case:

I want to get all Google My Business API place reviews using OAuth2 for internal project. I am using OAuth2 Playground for testing purposes while I am not able to get proper permission in these steps:

  1. Select & authorize APIs: pasting "https://www.googleapis.com/auth/business.manage" in the API field input & clicking "Authorize APIs"
  2. Letting myself obtain authorization code to obtain access token
  3. Using method GET, without additional headers I am able to obtain basic data about the project, but not from the particular place. I am able to list accounts.

Even in my project I was able to implement this: https://developers.google.com/my-business/content/implement-oauth. While I was able to use in OAuth2 Playground this: https://developers.google.com/my-business/content/account-data. But I need to use this: https://developers.google.com/my-business/content/review-data.

The error message in response:

      {
  "error": {
    "status": "PERMISSION_DENIED", 
    "message": "Google My Business API has not been used in project PROJECTCODE before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=PROJECTCODE then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", 
    "code": 403, 
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.Help", 
        "links": [
          {
            "url": "https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=PROJECTCODE", 
            "description": "Google developers console API activation"
          }
        ]
      }, 
      {
        "reason": "SERVICE_DISABLED", 
        "@type": "type.googleapis.com/google.rpc.ErrorInfo", 
        "domain": "googleapis.com", 
        "metadata": {
          "consumer": "projects/PROJECTCODE", 
          "service": "mybusiness.googleapis.com"
        }
      }
    ]
  }
}

After I access the project info from the link from response It will show error :"You do not have sufficient permissions to view this page" and this:

You are missing the following required permissions: Project resourcemanager.projects.get serviceusage.services.get

and links to the IAM docs which I find very confusing.

Questions:

  1. What am I missing in order to get review data from place belonging to the account I am accessing to?
  2. Am I using proper API access or method to reach my desired result?
  3. Could the problem be really in some IAM permissions? If so, how to set them to reach my goal?
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
svrl
  • 41
  • 7

2 Answers2

0

Please check if you have access to the Google My Business API by visiting https://console.cloud.google.com/apis/dashboard

Unlike the My Business Account Management API, the Google My Business API required to retrieve reviews is private.


Edit: the overview page is not the issue, I am talking about API access. It should show up in the list of enabled APIs:

Enabled APIs


Edit 2: You are missing the 9th API, the original Google My Business API. Since the documentation (https://developers.google.com/my-business/content/prereqs#request-access) does not mention how to get access to the old API, I would try contacting the API support if they still give out access to it: https://support.google.com/business/contact/api_default

vpgcloud
  • 1,294
  • 2
  • 10
  • 19
  • Yes I have access to this page without any trouble. – svrl Mar 15 '22 at 21:13
  • Edit recation: My Business Account Management API and My Business Business Information API is allowed. I was not able to namely find Google My Business API, but the all eight related APIs of Google are allowed. Might I ask what you thought specifically with Google My Business API? Or how to set it if it is not the set of the eight APIs? – svrl Mar 16 '22 at 08:26
  • Edit 2 reaction: OK, I will try to think it through and ask them for help. – svrl Mar 16 '22 at 14:43
0

in the message you received there is a link in url object

"links": [ { "url": "https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=PROJECTCODE", "description": "Google developers console API activation" }

copy that link, open it in the browser, and probably you need to sign into you account and then Enable the APi. Then you should be able to run your code or see what you want in playground

Shila Mosammami
  • 999
  • 6
  • 20
  • But I do that the resulting page has error – svrl Mar 27 '22 at 00:13
  • The error you published, tells that the service is not enabled and you should open the link they have provide you and enable it, maybe it takes a little time to be enabled but not more than 2 days. If you have another type of error please write it. – Shila Mosammami Mar 28 '22 at 07:25
  • As I wrote in the description, the link and the code gives me no viable answer. Link is deaf. Everything I know I had to enable I already enabled with no positive effect. – svrl Apr 02 '22 at 15:43