2

I'm trying to fetch reviews with the Google My Business API using Python, but since I'm new at this, I'm facing some problems I don't understand very well.

I created a service in order to use the my business api, and used the reviews method :

    path  = os.path.abspath('')+'\\'
    service, flags = sample_tools.init(['Google Reviews.ipynb'], "mybusiness", "v4", __doc__, path, 
                                       scope="https://www.googleapis.com/auth/business.manage", 
                                       discovery_filename=discovery_doc)

    reviewsApi = service.accounts().locations().reviews()
    request = reviewsApi.list(parent=location)

However, I keep getting this error :

reviewsApi = service.accounts().locations().reviews()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Resource' object has no attribute 'locations'

I think it is coming from the discovery doc I downloaded, which might be wrong (I don't remember where I got it from). I tried downloading it from this website :

using this link : text

But I don't think it is valid anymore :

Does anybody know how can I fix this problem please? Where can I find the correct discovery doc file? Or maybe I am not using the right API?

Sandra
  • 21
  • 1

1 Answers1

-1

This discovery document should work:

https://developers.google.com/static/my-business/samples/mybusiness_google_rest_v4p9.json (reference).

vpgcloud
  • 1,294
  • 2
  • 10
  • 19