最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get all google reviews using business api - Stack Overflow

programmeradmin0浏览0评论

I need all google reviews for particular location but I am unable to use business api from google. Here is url for get request

 

Now my question is what is the value for param account_name and location_name How can I get that.

Please answer with sample location example

I need all google reviews for particular location but I am unable to use business api from google. Here is url for get request

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.

Please answer with sample location example

Share Improve this question asked Dec 8, 2016 at 7:44 Bhavesh NariyaBhavesh Nariya 3652 gold badges7 silver badges25 bronze badges 1
  • 1 API says it's based on the JSON's name field. Scroll down to see Google identifier for this location in the form: accounts/{account_id}/locations/{location_id} – Ethan Commented Dec 8, 2016 at 8:34
Add a comment  | 

2 Answers 2

Reset to default 9

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 will work on the locations associated with your account so make sure you verified the LOCATIONS from any account you know. Then you can try out the api call you mentioned in OAuthplayground.

  1. Follow steps mentioned in below documentation URL to set it up: https://developers.google.com/my-business/content/prereqs

After the setup and etc you will automatically understand the account id and location id.

Also few more urls you can go to understand it better.

  1. https://console.developers.google.com (here you will setup your project)
  2. https://business.google.com/manage (here you will add/can see the locations - for which you need reviews)
  3. https://developers.google.com/my-business/content/basic-setup (Steps after completing the prereq)
  4. https://developers.google.com/oauthplayground (You will test the my business api here after approval)

When you make a request to https://mybusiness.googleapis.com/v3/accounts it gives you a list of accounts. On those accounts they have a field called name. That field is 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. On those locations they have a field called name. That field is accounts/account_name/locations/location_name.

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

评论列表(0)

  1. 暂无评论