0

Im struggling a lot with this issue and I just cant seem to find the answer to any of my questions.

The task that I have been set is to have the ability to list all of the reviews for a customers business.

So the workflow would be

  1. Log into the platform
  2. Go to the social settings page and auth google
  3. Somewhere in the interface show all reviews from google my business

So far ive created the oAuth tokens, Added the client and secret and am getting valid tokens

This is where I have become stuck, Im using https://github.com/googleapis/google-api-php-client

Should I be using this? I cant find exactly how to actually use it for getting the reviews etc.

A quick snipped of using the client is here

$client = new Client();
$client->setClientId($wholeSaler->getGoogleConsumerKey());
$client->setClientSecret($wholeSaler->getGoogleConsumerSecret());
$client->setRedirectUri('https://' . SiteSession::get_url() . '/api/google-auth/');
$client->addScope(self::getScopes());
$client->setAccessToken($this->getFullToken());

return $client;

This gets me a valid instance of "Client" But I cant seem to find where to go from here

Do these classes $something2 = new \Google\Service\MyBusinessBusinessInformation(); Actually do the work? Or do I create my own API Calls?

Any little nudge forward on this would be greatly appreciated!

Cheers Ryan

Hadley8899
  • 136
  • 1
  • 12
  • MyBusinessBusinessInformation won't help with getting reviews, it's the wrong API , you still need the old v4.9 GMB API for this. Have you found/read this yet https://stackoverflow.com/questions/68161091/google-my-business-api-i-managed-to-display-all-reviews – vpgcloud Jun 15 '22 at 16:42
  • 1
    Ahh I see, Its the one service that sounded as if it was closest to what I wanted, But these service classes dont appear to do much and I couldnt find any clear docs on them. Thanks that post does genuinely look helpful. Ill have a play tommorow when Im back in the office – Hadley8899 Jun 15 '22 at 16:49

0 Answers0