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

using findMatches to find locations

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

Could you provide a simple example in PHP for using the findMatches method to find unverified Locations?  I am attempting to associate unverified locations per guidance here:

 

https://www.en.advertisercommunity.com/t5/Google-My-Business-API/Google-Places-API-and-My-Business-A...

 

I've tried passing a 

Google_Service_Mybusiness_FindMatchingLocationsRequest

 

as the second param to this method with no success.  Any guidance would be greatly appreciated.

 

Many thanks!

 

1 Expert replyverified_user

Re: using findMatches to find locations

[ Edited ]
Google Employee
# 2
Google Employee

Hi @David L,

 

We suggest you please follow the code below for the PHP application to find all of the possible locations on Google Maps that are a match to the specified location with Google API Client Library for PHP via the Google My Business API:

 

// Finds all of the possible locations that are a match to the specified location.
$findMatchingLocationsRequest = new Google_Service_Mybusiness_FindMatchingLocationsRequest();
$findMatchingLocationsRequest->setLanguageCode("en");
$findMatchingLocationsRequest->setNumResults(5);
$findMatchingLocationsResponse = $locations->findMatches($location->name, $findMatchingLocationsRequest);
var_dump($findMatchingLocationsResponse);

 

I hope this helps!

 

Thanks,

The Google My Business API team