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

Problem with Multi-PlaceID Locations

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

Hello there,

 

We are seeing a strange error on at least 2 client locations whose service areas are defined using a list of placeIds. We are passing in something like the following (abbreviated from the larger Location object):

 

"serviceArea":{  
   "businessType":"CUSTOMER_LOCATION_ONLY",
   "places":{  
      "placeInfos":[  
         {  
            "name":"Nashville, Tennessee 37211",
            "placeId":"ChIJ9ZAglDdvZIgRYVfFSXKvwWM"
         },
         {  
            "name":"Nashville, Tennessee 37220",
            "placeId":"ChIJc7ciYt9kZIgR1R8MfbgNqO8"
         },
         {  
            "name":"Nashville, Tennessee 37204",
            "placeId":"ChIJTQp0kLZlZIgRy2zdKVnxfzM"
         }
        ...  about 10 more ... placeIds

 

And we are getting back an error like this:

 

{  
   "code":400,
   "message":"Request contains an invalid argument.",
   "status":"INVALID_ARGUMENT",
   "details":[  
      {  
         "@type":"type.googleapis.com/google.mybusiness.v3p1.ValidationError",
         "errorDetails":[  
            {  
               "code":14,
               "field":"service_area.places.place_info",
               "message":"The type associated with the provided placeId is not supported.",
               "value":"[neighborhood, political]"
            }
         ]
      }
   ]
}

 

Any ideas as to what is going on? The list of placeIds is created using the normal GMB dashboard BTW (see attached image).

 

gmbApiStrangeness.png

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by topic author Stephen K
November 2016

Re: Problem with Multi-PlaceID Locations

Google Employee
# 2
Google Employee

Hi @Stephen K,

 

As far as I’m concerned, you should only provide the ServiceAreaBusiness object including placeIds in the placeInfos field during update in a PATCH request. You should get a 500 Internal Server Error if you insert the ServiceAreaBusiness object during creation in a POST request. We will update you in this thread when the issue about the 500 Internal Server Error for including the ServiceAreaBusiness object in a POST request to create a new location has been resolved.

 

For troubleshooting this specific 400 Bad Request error, please provide me with the specific locationId for the location and the full HTTP request message of the PATCH request to update or a POST request to create, including the JSON payloads of request body & response body.

 

Thanks,

Terry

Problem with Multi-PlaceID Locations

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Just to follow up on this question ...

 

Terry's response inspired me to refactor our code so that we are only sending deltas in PATCH requests, and not the entire location object. This seems to have fixed issue.

 

As a feature request I think it would be sweet to provide this delta calculation within the client libraries so that you could write something like:

 

Location existingGoogleValue = // initialization

Location existingStephenValue = // initialization

Location patchLocation = existingGoogleValue.diff(existingStephenValue)

 

Or something along those lines. In a similar vein, the clone() functionality I have found to be tremendously useful BTW.

 

Re: Problem with Multi-PlaceID Locations

Google Employee
# 4
Google Employee

Hi @Stephen K,

 

We are aware of your feature request/suggestion to add delta encoding to the Google My Business API. We suggest you use a version control system at your end for this purpose. We’ll announce new features of the Google My Business API when they become available on both this board and the Google Developers site. Please stay tuned for updates!

 

Thanks,

Terry