Closed nekromoff closed 5 years ago
// oauth2 code here to get a token etc., then proceed with a returned token
$client = $this->initializeClient($known_token, ['https://www.googleapis.com/auth/plus.business.manage']);
$service = new \Google_Service_MyBusiness($client);
// get GMB accounts
$accounts = $service->accounts->listAccounts()->getAccounts();
// get GMB account locations (for the first account)
$locations = $service->accounts_locations->listAccountsLocations($accounts[0]['name']);
// get posts for the selected location
$service->accounts_locations_localPosts->listAccountsLocationsLocalPosts($locations[0]['name'])
I'll be adding more tutorials here as I progress.
Hi @nekromoff
You're welcome to open a PR. I'm closing this issue.
I mean, I have experience with other Google APIs, but this has similar parametrization to GTM API and one can dump the main service to get classes and methods etc., but some basic how-to should be included.