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

Google Places API and My Business API

[ Edited ]
Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Hello,

Our application flow is the following;

  1. A user creates a place on our application with correct data about her business
  2. The user is asked to link her place to the places on social platforms, Google being one of them
  3. We search the places API for a list of places and present them to the user of our application to choose as "this is my business"
  4. The user chooses one of the places confirming that as her business
  5. Since this place comes from the Places endpoint, we have the following information available to us at this point:
    1. the place ID
    2. the google maps link, this is the result.url field in the response of the place details endpoint (curl -X "GET" "https://maps.googleapis.com/maps/api/place/details/json?key=<API_KEY>&placeid=<PLACE_ID>")
  6. Once the user has identified one of the results as her business, we ask the user to authenticate so we can access her businesses, based on the information in step 6.
  7. Once the authentication completes, we make a request to https://mybusiness.googleapis.com/v3/accounts/<account-id>/locations which responds with; 
    {
     
    "locations": [
       
    {
         
    "locationKey": {
           
    "plusPageId": "<plus_page_id>"
         
    },
         
    "openInfo": {
           
    "status": "OPEN"
         
    },
         
    "name": "accounts/<acc_id>/locations/<loc_id>",
         
    "latlng": {
           
    "latitude": 51.048690999999998,
           
    "longitude": 3.721816
         
    },
         
    "locationName": "<name>",
         
    "photos": {},
         
    "primaryPhone": "<phone>",
         
    "address": {
           
    "postalCode": "<postal_code>",
           
    "country": "<ctr_code>",
           
    "addressLines": [
             
    "<addr_line>"
           
    ],
           
    "locality": "<loc>"
         
    },
         
    "metadata": {},
         
    "primaryCategory": {
           
    "name": "Beer shop",
           
    "categoryId": "gcid:beer_store"
         
    },
         
    "locationState": {
           
    "canUpdate": true,
           
    "canDelete": true
         
    }
       
    }
     
    ]
    }
  8. What we're struggling with is this
    1. the place ids reported in the places API seems to have no correlation to the business IDs.
    2. we cannot identify which business the  user intended to grant us access to, since we can only search the places API for a list of potential places the user may want to manage.

What we'd like to know is

  • What is the relationship, if any, between the place_ids and the business ID's?
  • can we use a place_id to get a business ID?
  • is the flow intended to be different from what we're doing? (asking the user to authenticate first and then ask her which business the user intended to manage?)

Thanks.

2 Expert replyverified_user

Re: Google Places API and My Business API

Google Employee
# 2
Google Employee

Hi @Ashesh A,

 

You can use the new functionalities introduced for v3 of the Google My Business API to associate an unverified location to a specified place ID without using the Google Places API. Please note the following:

  • A place ID uniquely identifies a place that appears on Google Maps and may not have a direct correlation with a locationId. A verified location should have a placeId in the LocationKey object but an unverified location may or may not have a placeId in the LocationKey object.
  • You cannot use a place ID to get the list of locationIds that are associated with it; however, you can check if a location with a specific locationId has a placeId in the LocationKey object.

 

We suggest the following workflow for creating and associating an unverified location to a place ID via the Google My Business API, and then have the business owner verify the location:

  1. Use OAuth 2.0 for authentication and authorization to access the user’s Google My Business data or have the user share their existing Google My Business locations with you in business accounts. Learn more
  2. Create a new, unverified location under a specified account using the business information that the user has submitted.
  3. Find all of the possible locations that are a match to the unverified location with each location’s corresponding placeId in the LocationKey object. Please note that possible matched locations may not always be found.
  4. Upon the user’s selection and approval, associate the unverified location to a specified place ID. Please note that this operation is only valid if the location is unverified and the association must be with one of the locations among the list of matched locations retrieved in step 3.
  5. You can clear an association between an unverified location and its place ID if an association has been made and the user disapproves of it.
  6. The user can then verify the location for it to be eligible to show up on Google Maps and other Google properties. We recommend that business owners, whenever possible, create and verify their own locations and add the authorized representatives of agencies/third-parties to the locations as managers. Learn more

 

Thanks,

Terry

Google Places API and My Business API

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Google Business allows to upload photos. But, is there a way to access more than 10 photos? Places api returns an array of 10 photos only.

Re: Google Places API and My Business API

Google Employee
# 4
Google Employee

Hi @Sudharsan R,

 

In Google My Business, you can access more than 10 photos but each location can have no more than 25 additional photos. Please make sure that the photos meet the Google My Business guidelines and the specifications of the Photos object documented on our Google Developers site.

 

Thanks,

Shalini

Google Places API and My Business API

[ Edited ]
Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

For this recommendation (associating a location to an account using a place_id)....what is best practice for finding a Location which is already verified and/or published?

 

For example, what if the user wants to request admin/management status on a Location (which could have been identified via the Places API)?  How does one go about doing this (with a place_id retrieved from the Places API)?  Based on this thread, it sounds like you need to re-create an entire new entry for the Location, get it assigned to the account as a duplicate entry, and then resolve the duplicate status?  Seems like a really convoluted way of doing things, want to confirm before moving ahead...

Re: Google Places API and My Business API

[ Edited ]
Google Employee
# 6
Google Employee

Hi @David L,

 

Unfortunately we don’t have a way to claim already verified locations through the Google My Business API. You will need to request ownership or manager rights to the location via the Google My Business UI.

 

Please note that, during location verification, you should follow these steps if you find that someone else verified your business in a different Google Account.

 

Thanks,

The Google My Business API team

Google Places API and My Business API

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi Shalini,

 

Thanks for your clarification re: verified locations.

 

As far as unverified locations, it is my understanding that Terry's solution as explained above in this thread is the way to go:

 

--create a new Location in the account,

--use findMatches to determine if the same unverified Location already exists

--if an existing unverified location is found, associate Location to account and proceed with Location verification (and what to do with the newly created Location?)

--if no existing unverified location is found, proceed with Location verification for the newly created location.

 

Thanks in advance for your guidance; we want to make sure we are doing things the correct way per GMB guidance.

Google Places API and My Business API

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

We are facing similar scenario. 

After following your guided steps, i have one small question. After i associate place id with unverified business location, i want to get the reviews of that place after association.

But Google Business API is returning 0 reviews. When are we able to get those reviews?

Re: Google Places API and My Business API

Google Employee
# 9
Google Employee

Hi @Danyal M,

 

In the Google My Business API, the review operation is only valid if the specified location is verified, the only boolean field of the LocationState object in a location you should check for is isVerified.

 

Thanks,

The Google My Business API team

Google Places API and My Business API

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Thank you Shalini S for quick response.

I have posted question on stackoverflow and on GMB too.

The second question i have is that

"Is it possible to associate a place Id with businesses location which is not returned by Google Business "Find Matches" endpoint?