简体   繁体   English

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

[英]How to get all google reviews using business api

I need all google reviews for particular location but I am unable to use business api from google. 我需要针对特定​​位置的所有谷歌评论,但我无法使用谷歌的业务API。 Here is url for get request 这是获取请求的URL

https://mybusiness.googleapis.com/v3/accounts/account_name/locations/location_name/reviews 

Now my question is what is the value for param account_name and location_name How can I get that. 现在我的问题是param account_name和location_name的值是什么我怎么能得到它。

Please answer with sample location example 请回答示例位置示例

I think first of all you need to white list your google my business api for whatever project you are working on in your project as its private api. 我认为首先你需要将你的google my business api白名单列入你的项目作为私人api的任何项目。 Google my business api will work on the locations associated with your account so make sure you verified the LOCATIONS from any account you know. Google我的商家api将处理与您的帐户相关联的位置,因此请务必从您知道的任何帐户验证LOCATIONS。 Then you can try out the api call you mentioned in OAuthplayground. 然后,您可以尝试在OAuthplayground中提到的api调用。

  1. Follow steps mentioned in below documentation URL to set it up: https://developers.google.com/my-business/content/prereqs 按照以下文档网址中提到的步骤进行设置: https//developers.google.com/my-business/content/prereqs

After the setup and etc you will automatically understand the account id and location id. 设置等后,您将自动了解帐户ID和位置ID。

Also few more urls you can go to understand it better. 还有更多的网址,你可以更好地了解它。

  1. https://console.developers.google.com (here you will setup your project) https://console.developers.google.com (在这里您将设置您的项目)
  2. https://business.google.com/manage (here you will add/can see the locations - for which you need reviews) https://business.google.com/manage (在这里您将添加/可以查看您需要评论的位置)
  3. https://developers.google.com/my-business/content/basic-setup (Steps after completing the prereq) https://developers.google.com/my-business/content/basic-setup (完成prereq后的步骤)
  4. https://developers.google.com/oauthplayground (You will test the my business api here after approval) https://developers.google.com/oauthplayground (您将在批准后在此处测试我的商家API)

When you make a request to https://mybusiness.googleapis.com/v3/accounts it gives you a list of accounts. 当您向https://mybusiness.googleapis.com/v3/accounts发出请求时,它会为您提供一个帐户列表。 On those accounts they have a field called name. 在这些帐户上,他们有一个名为name的字段。 That field is accounts/account_name. 该字段是accounts / account_name。

{
  "state": {
    "status": "UNVERIFIED"
  }, 
  "type": "PERSONAL", 
  "name": "accounts/1337", 
  "accountName": "example"
}

When you make a request to https://mybusiness.googleapis.com/v3/accounts/account_name/locations it gives you a list of locations. 当您向https://mybusiness.googleapis.com/v3/accounts/account_name/locations发出请求时,它会为您提供位置列表。 On those locations they have a field called name. 在这些位置,他们有一个名为name的字段。 That field is accounts/account_name/locations/location_name. 该字段是accounts / account_name / locations / location_name。

{
  "locations": [
    {
      "languageCode": "en", 
      "openInfo": {
        "status": "OPEN", 
        "canReopen": true
      }, 
      "name": "accounts/1337/locations/13161337", 
      ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM