If I have api key of Business API, i just want example of URL, like how to put the place id and api key.
3 Answers
If Google have authorized you to use Google Business API then you need to
- Authenticate the user via OAuth.
- After authentication which will give you the token, API will return you the users's account.
- Now to get the reviews you have to make Http Get request to the endpoint below https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationid}/reviews
Your Http Get request must have Access Token
For Example: https://mybusiness.googleapis.com/.../reviews??access_token={tokenHere}
this will return you all the reviews.
Ref: https://developers.google.com/my-business/reference/rest/v4/accounts.locations.reviews
Hope that answered your Question.

- 198
- 11
-
https://mybusiness.googleapis.com/.../reviews??access_token={tokenHere} In this what is "..." ??? pls guide with exact URL – Praveen Hegde Jan 08 '18 at 10:15
-
1https://mybusiness.googleapis.com/v4/accounts/{accountIdHere}/locations/{locationIdHere}/reviews?access_token={tokenHere} – Danyal Malik Jan 09 '18 at 11:17
-
how we can get the accountId? – Bilal Siddiq Jan 24 '20 at 09:22
*Please note, support of v3 of the API ended on March 10, 2018; v3 will no longer be available on May 10th 2018. So we encourage you to migrate to v4.1 as soon as possible to prevent any interruption in functionality. In addition, the deprecation schedule can be found here
You can get Google My business (GMB) reviews in same ways
Please find the below working code for review reply with PHP HTTP request
$access_token = "<your_access_token_here>";
$query = array('comment' => 'Thank you for visiting our business!');
$request_uri = "https://mybusiness.googleapis.com/v4/accounts/111050869667910417441/locations/17405754705905257334/reviews/AIe9_BFu3rdicGrPrzdyu4PDXmqMAu-9BCJf9_HF0DxzGxsjAGw5KGl1XsdqSkbsAMdl_W2XBG4bwO3wCp0_l_8KLAV7mckl5cSyJItwPqSYGiH3ktK6nrI/reply?access_token=" . $access_token;
$curinit = curl_init($request_uri);
curl_setopt($curinit, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curinit, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($curinit, CURLOPT_POSTFIELDS, json_encode($query));
curl_setopt($curinit, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curinit, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen(json_encode($query)))
);
$json = curl_exec($curinit);
$phpObj = json_decode($json, true);
var_dump($phpObj);

- 439
- 3
- 7
-
I am getting 400 error with message ' Request contains an invalid argument. ' . I am passing comment inside json body. – Manish Champaneri Jul 23 '19 at 11:19
-
Could you please paste your code here ? So that I can debug and reply to you. – Mohd Abdul Baquee Jul 27 '19 at 10:07
-
@MohdAbdulBaquee Can Google My Business API be used to find the reviews of any person such as a doctor or businessman ? I need some help related to this API. Can you please help me with it ? – Mansi May 22 '20 at 07:31
-
@Mansi You can pull all reviews, insights and private data of authenticated user using Google My Business API. – Mohd Abdul Baquee Jun 20 '20 at 13:57
-
@MohdAbdulBaquee Can U pls provide steps how did you configure oAuth for my business? what is the authorization url and how did you get your accountId? thanks – camel Apr 20 '21 at 20:26
-
You can follow the below link for more details. https://packagist.org/packages/abdulbaquee/unofficial-google-my-business – Mohd Abdul Baquee Apr 24 '21 at 09:19
This code worked for me. I used the curl library to answer a review. I hope it serves you
$url = "https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/reviews/{reviewId}/reply";
$access_token = {access token google}
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$query = array('comment' => 'Thank You!');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query));
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer '.$access_token.'', 'Content-Type: application/json', 'Content-Length: ' . strlen(json_encode($query))) );
$response = curl_exec($ch);
echo $response;
curl_close($ch);

- 21
- 1