如何使用商业API获取所有谷歌评论

Bha*_*iya 5 javascript php google-places-api google-my-business-api

我需要针对特定​​位置的所有谷歌评论,但我无法使用谷歌的业务API.这是获取请求的URL

https://mybusiness.googleapis.com/v3/accounts/account_name/locations/location_name/reviews 
Run Code Online (Sandbox Code Playgroud)

现在我的问题是param account_name和location_name的值是什么我怎么能得到它.

请回答示例位置示例

Hmm*_*mmm 6

我认为首先你需要将你的google my business api白名单列入你的项目作为私人api的任何项目.Google我的商家api将处理与您的帐户相关联的位置,因此请务必从您知道的任何帐户验证LOCATIONS.然后,您可以尝试在OAuthplayground中提到的api调用.

  1. 按照以下文档网址中提到的步骤进行设置:https: //developers.google.com/my-business/content/prereqs

设置等后,您将自动了解帐户ID和位置ID.

还有更多的网址,你可以更好地了解它.

  1. https://console.developers.google.com(在这里您将设置您的项目)
  2. https://business.google.com/manage(在这里您将添加/可以查看您需要评论的位置)
  3. https://developers.google.com/my-business/content/basic-setup (完成prereq后的步骤)
  4. https://developers.google.com/oauthplayground(您将在批准后在此处测试我的商家API)


B.A*_*ler 5

当您向https://mybusiness.googleapis.com/v3/accounts它提出请求时,它会为您提供一个帐户列表。在这些帐户上,他们有一个名为 name 的字段。该字段是帐户/帐户名称。

{
  "state": {
    "status": "UNVERIFIED"
  }, 
  "type": "PERSONAL", 
  "name": "accounts/1337", 
  "accountName": "example"
}
Run Code Online (Sandbox Code Playgroud)

当您向https://mybusiness.googleapis.com/v3/accounts/account_name/locations它发出请求时,它会为您提供位置列表。在这些位置,他们有一个名为 name 的字段。该字段是accounts/account_name/locations/location_name。

{
  "locations": [
    {
      "languageCode": "en", 
      "openInfo": {
        "status": "OPEN", 
        "canReopen": true
      }, 
      "name": "accounts/1337/locations/13161337", 
      ...
}
Run Code Online (Sandbox Code Playgroud)