'Google My Business Information API - Get locations list of the authenticated account with php library

I'm currently working with Google API through this great php library but it doesn't support the last API and most of his method are going to be deprecated.

I already developed the Google authentication.

I now need to get the list of the locations managed by the authenticated Google account.

I'm quite sure I need to call this api but I need to do it through the official PHP library.

Unfortunately there isn't any documentation of this PHP library so I tried different approach but I was never able to get them.

Here one of my attempt:

$client = new Google_Client();
$client->setAuthConfig($this->CLIENT_SECRET_PATH);
$client->addScope(self::GOOGLE_CLIENT_SCOPE);
$client->setAccessToken($this->gmb_access_token);
$this->gmb_client = new Google\Service\MyBusinessBusinessInformation($client);
$account_locations = $this->gmb_client->accounts_locations->getLocations;

But the response is empty.

Any help would be really appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source