Unable to get review listing for Location using PHP[ Edited ]
January 2017 - last edited January 2017
I am using Google MyBusiness API for fetching all business reviews. But I am unable to get it with PHP syntax and GET, POST method use in MyBusiness.
I am sure that I am missig something with syntax or param pass to the function so please guide me with some sample of PHP code using MyBusiness api. Have done oAuth 2.0
Here is my code where I am passing my location name. Also I want to know that can i get other accounts location info?
$mybusinessService = new Google_Service_Mybusiness($client);
$reviews = $mybusinessService->accounts_locations_reviews;
With above code I am getting error 404 (Fatal error: Uncaught exception 'Google_Service_Exception' with message)
Re: Unable to get review listing for Location using PHP
Hi @GoHotNews C,
Please make sure you are using the OAuth 2.0 installed application flow and persisting the refresh token for your application so that it will always be able to request a new access token when necessary. We suggest you please checkout this thread for fetching all business reviews for specified location with the Google API Client Library for PHP.
Note that PHP client library doesn’t currently support the display of detailed error messages. Please follow the Make a simple HTTP request step-by-step guide on the Google Developers site to learn how to use the OAuth 2.0 Playground for troubleshooting errors with detailed error messages when sending requests with data via the Google My Business API.
The Google My Business API team