My Business
2.2K members online now
2.2K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Issue in posting a reply to review

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I am able to access business data through http calls. While working with review data I am trying to reply to the review and in response I am getting update time and nothing else but when I try to confirm there is no reply at that particular review. I am wondering whats the exact issue as there is no error and I am getting update time in response.
1 Expert replyverified_user

Re: Issue in posting a reply to review

Google Employee
# 2
Google Employee

Hi @Taha H,

 

You should be able to reply a review by using the accounts.locations.reviews.reply method via the Google My Business API. Please note, this operation is only valid if the specified location is verified.

 

Could you please provide us with the full HTTP request message of the POST request including the URI, and the JSON payloads of request body as well as the response body for triggering this error so that we can help you troubleshoot this issue further.

 

Thanks,

The Google My Business API team

Issue in posting a reply to review

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi @ShaliniS

 

Here are the code details:

 

$this->client = new \Google_Client();
$this->client->setAuthConfig(base_path().'/resources/assets/client_secret.json');
$this->client->addScope('https://www.googleapis.com/auth/plus.business.manage');
$this->redirect_uri = url('/callback');
$this->client->setRedirectUri($this->redirect_uri);

$this->guzzle = new Client(); //GuzzleHttp\Client

 

if (session('access_token')) {
$this->client->setAccessToken(session('access_token'));

if (empty($location_name))
$location_name = session('location_name');

 

$result = $this->guzzle->post('https://mybusiness.googleapis.com/v3/'.$location_name.'/reviews/'.$review_id.'/reply', [
'headers' => [
"Authorization"=> "Bearer ".session('access_token')['access_token']
],
'comment' => $comment
]);
echo $result->getBody();
}

 

Here is the detailed URI:

http://local.review.com/api/reply?location=accounts/101370363947595122759/locations/6311902239568655...

 

Here is http call response
{ "updateTime": "2017-03-17T19:41:18Z" }

Re: Issue in posting a reply to review

Google Employee
# 4
Google Employee

Hi @Taha H,

 

Given the security implications of getting the implementation correct, we strongly encourage you to use OAuth 2.0 libraries when interacting with Google's OAuth 2.0 endpoints. It is a best practice to use well-debugged code provided by others, and it will help you protect yourself and your users. For more information, see Client libraries.

 

We suggest you 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.

 

Thanks,

The Google My Business API team