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

The specified address cannot be located when updating

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

Hello!

 

I've created a new location in MyBusiness using the API and sending the address:

Av. de la Alegría, 42190 Golmayo, Soria, Spain

The fact is that the location has been created successfully but I cannot update it now. 

The API is responding:

 

{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError", "errorDetails": [ { "code": 1100, "field": "address", "message": "The specified address cannot be located." } ] } ] } }

 

But I'm sending the same address that in the "create" request and using the same request payload but removing the LatLng (that is ReadOnly). I'm just trying to update the location. Why I'm getting the address error? 

 

Do you know why GMB is not accepting the address when trying to update but it accepts the same address components when creating?

1 Expert replyverified_user

Re: The specified address cannot be located when updating

Google Employee
# 2
Google Employee

Hi @David R,

 

According to your post, it sounds like you are creating a new location instead of sending a PATCH request to update the address for your location in Google My Business API.

 

I suggest you please send a PATCH request with the locationId to update your location in Google My Business and make sure you always include a fieldMask for specific fields when you are updating a location to avoid overwriting data inadvertently.

 

Please follow the HTML request below:

HTTP Method: PATCH  
Request URI: https://mybusiness.googleapis.com/v3/accounts/account_name/locations/locationId?languageCode=language&validateOnly=false&fieldMask=address

 

I hope this helps!

 

Thanks,

Shalini

The specified address cannot be located when updating

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

Hi Shalini,

 

I'm not creating a new location. I'm sending a PATCH request to update an existent one.

 

The problem here is that I can use a given address to create a location, but I cannot use the same address (with exactly the same address components) to update an existent location.

 

Do you know why?

Re: The specified address cannot be located when updating

Google Employee
# 4
Google Employee

Hi @David R,

 

Could you please post the full PATCH request including the query parameters and request body you used for OAuth 2.0 Playground when updating your location? It will help us to troubleshoot your issue.

 

Thanks,

The Google My Business API team

Re: The specified address cannot be located when updating

Follower ✭ ☆ ☆
# 5
Follower ✭ ☆ ☆

Of course, I've some of them:

 

This is the destination URL with params for all the requests:

PATCH https://mybusiness.googleapis.com/v3/accounts/#{account_id}/locations/#{location_id}?languageCode=en

Obviously, having a different 'account_id' and 'location_id' depending on the request.

 

I've also tried to change the languageCode to 'es' and I've also used the 'validateOnly=true' param to perform some additional tests.

 

Request body:

 

{"address"=>{"country"=>"ES", "locality"=>"Los Llanos", "postalCode"=>"38768", "addressLines"=>["Av. Venezuela s/n"], "administrativeArea"=>"ES-TF"}, "openInfo"=>{"status"=>"OPEN"}, "websiteUrl"=>"https://canarias.worten.es/tiendas/canarias/worten-trocadero", "locationName"=>"Worten La Palma-Trocadero", "primaryPhone"=>"+34902026620", "regularHours"=>{"periods"=>[{"openDay"=>"FRIDAY", "closeDay"=>"FRIDAY", "openTime"=>"09:30", "closeTime"=>"21:00"}, {"openDay"=>"MONDAY", "closeDay"=>"MONDAY", "openTime"=>"09:30", "closeTime"=>"21:00"}, {"openDay"=>"SATURDAY", "closeDay"=>"SATURDAY", "openTime"=>"09:30", "closeTime"=>"21:00"}, {"openDay"=>"THURSDAY", "closeDay"=>"THURSDAY", "openTime"=>"09:30", "closeTime"=>"21:00"}, {"openDay"=>"TUESDAY", "closeDay"=>"TUESDAY", "openTime"=>"09:30", "closeTime"=>"21:00"}, {"openDay"=>"WEDNESDAY", "closeDay"=>"WEDNESDAY", "openTime"=>"09:30", "closeTime"=>"21:00"}]}, "primaryCategory"=>{"categoryId"=>"gcid:electronics_store"}, "additionalCategories"=>[{"categoryId"=>"gcid:computer_store"}, {"categoryId"=>"gcid:cell_phone_store"}]}

Response:

 

{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError", "errorDetails": [ { "code": 1100, "field": "address", "message": "The specified address cannot be located." } ] } ] } }

 

 

Or this other one:

Request body:

 

{"address"=>{"country"=>"ES", "locality"=>"Pola de Siero", "postalCode"=>"33429", "addressLines"=>["Calle Paredes, s/n (C.C. Parque Principado)"], "administrativeArea"=>"ES-O"}, "openInfo"=>{"status"=>"OPEN"}, "storeCode"=>"1127", "websiteUrl"=>"http://www.ginos.es/restaurante/parque-principado-paredes-pola-de-siero", "locationName"=>"Ginos Parque Principado", "primaryPhone"=>"+34984768042", "regularHours"=>{"periods"=>[{"openDay"=>"FRIDAY", "closeDay"=>"FRIDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"FRIDAY", "closeDay"=>"SATURDAY", "openTime"=>"20:00", "closeTime"=>"00:30"}, {"openDay"=>"MONDAY", "closeDay"=>"MONDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"MONDAY", "closeDay"=>"MONDAY", "openTime"=>"20:00", "closeTime"=>"23:30"}, {"openDay"=>"SATURDAY", "closeDay"=>"SATURDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"SATURDAY", "closeDay"=>"SUNDAY", "openTime"=>"20:00", "closeTime"=>"00:30"}, {"openDay"=>"SUNDAY", "closeDay"=>"SUNDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"SUNDAY", "closeDay"=>"SUNDAY", "openTime"=>"20:00", "closeTime"=>"23:30"}, {"openDay"=>"THURSDAY", "closeDay"=>"THURSDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"THURSDAY", "closeDay"=>"THURSDAY", "openTime"=>"20:00", "closeTime"=>"23:30"}, {"openDay"=>"TUESDAY", "closeDay"=>"TUESDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"TUESDAY", "closeDay"=>"TUESDAY", "openTime"=>"20:00", "closeTime"=>"23:30"}, {"openDay"=>"WEDNESDAY", "closeDay"=>"WEDNESDAY", "openTime"=>"13:00", "closeTime"=>"16:30"}, {"openDay"=>"WEDNESDAY", "closeDay"=>"WEDNESDAY", "openTime"=>"20:00", "closeTime"=>"23:30"}]}, "primaryCategory"=>{"categoryId"=>"gcid:restaurant"}, "additionalCategories"=>[{"categoryId"=>"gcid:italian_restaurant"}]}

Response:

 

{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError", "errorDetails": [ { "code": 1100, "field": "address", "message": "The specified address cannot be located." } ] } ] } }

Another example:

Request body:

{"address"=>{"country"=>"ES", "locality"=>"Jerez de la Frontera", "postalCode"=>"11408", "addressLines"=>["Luz Shopping, Avda. Escandinavia, Marchanudo Alto"], "administrativeArea"=>"ES-CA"}, "openInfo"=>{"status"=>"OPEN"}, "storeCode"=>"#1347", "websiteUrl"=>"https://www.worten.es/tiendas/andalucia/worten-jerez", "locationName"=>"Worten Jerez", "primaryPhone"=>"+34902026620", "regularHours"=>{"periods"=>[{"openDay"=>"FRIDAY", "closeDay"=>"FRIDAY", "openTime"=>"10:00", "closeTime"=>"22:00"}, {"openDay"=>"MONDAY", "closeDay"=>"MONDAY", "openTime"=>"10:00", "closeTime"=>"22:00"}, {"openDay"=>"SATURDAY", "closeDay"=>"SATURDAY", "openTime"=>"10:00", "closeTime"=>"22:00"}, {"openDay"=>"THURSDAY", "closeDay"=>"THURSDAY", "openTime"=>"10:00", "closeTime"=>"22:00"}, {"openDay"=>"TUESDAY", "closeDay"=>"TUESDAY", "openTime"=>"10:00", "closeTime"=>"22:00"}, {"openDay"=>"WEDNESDAY", "closeDay"=>"WEDNESDAY", "openTime"=>"10:00", "closeTime"=>"22:00"}]}, "specialHours"=>{"specialHourPeriods"=>[{"endDate"=>{"day"=>24, "year"=>2015, "month"=>12}, "openTime"=>"10:00", "closeTime"=>"20:00", "startDate"=>{"day"=>24, "year"=>2015, "month"=>12}}, {"isClosed"=>true, "startDate"=>{"day"=>25, "year"=>2015, "month"=>12}}, {"endDate"=>{"day"=>31, "year"=>2015, "month"=>12}, "openTime"=>"10:00", "closeTime"=>"20:00", "startDate"=>{"day"=>31, "year"=>2015, "month"=>12}}, {"isClosed"=>true, "startDate"=>{"day"=>1, "year"=>2016, "month"=>1}}, {"isClosed"=>true, "startDate"=>{"day"=>6, "year"=>2016, "month"=>1}}]}, "primaryCategory"=>{"categoryId"=>"gcid:electronics_store"}, "additionalCategories"=>[{"categoryId"=>"gcid:computer_store"}, {"categoryId"=>"gcid:cell_phone_store"}]}

With same response:

{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError", "errorDetails": [ { "code": 1100, "field": "address", "message": "The specified address cannot be located." } ] } ] } }

There're a lot of similar examples. Please, keep in mind that I'm sending the complete list of location attributes in the Payload because the user must be able to edit the params whenever he wish.. So, I cannot consider using the 'fieldMask' attribute to remove the 'address' attribute from the payload and avoid the error.

 

Thanks! :)

Re: The specified address cannot be located when updating

Google Employee
# 6
Google Employee

Hi @David R,

 

We are still trying to replicate the issue you reported and will follow up soon with a response. Thanks for your patience.

 

Thanks,

The Google My Business API team

Re: The specified address cannot be located when updating

Google Employee
# 7
Google Employee

Hi @David R,

 

We replaced the addressLines field of the Address object in your PATCH request to “Av Venezuela 10” as shown exactly on Maps and the PATCH request passed system validation and updated the location successfully. We did same process with your other locations as well and all worked as expected.

 

If you are certain that the address you entered is up to date and contains no extraneous information, and you are still getting the 400 Bad Request error with the message "The specified address cannot be located." that typically happens when the system cannot geocode the specified address. You can fix this geocode error by dropping a pin for your business location through the Google My Business UI.

 

Please note, you should always include languageCode and validateOnly parameters in your PATCH request when you update a location in Google My Business API. Since you are not adding fieldmask in your PATCH request so just for your information, if no mask is specified, then this is treated as a full update and all fields are set to the values passed in, which may include unsetting empty fields in the request.

 

I hope this helps!

 

Thanks,

The Google My Business API team

The specified address cannot be located when updating

Follower ✭ ☆ ☆
# 8
Follower ✭ ☆ ☆

Wow,

 

Seems like you can specify the 'latlng' attribute in the PATCH requests from now? I was doing some tests and the API started accepting me the latitude and longitude attribute.

 

With the "latlng" attribute you can also specify a more 'flexible' street_address.

The specified address cannot be located when updating

Follower ✭ ☆ ☆
# 9
Follower ✭ ☆ ☆

Sorry, no, this is only working when using the param validateOnly=true in the request. It also fails with an invalid address error when sending 'real' requests (without the ?validateOnly param). So, I will continue investigating how to send addresses without street number to the GMB API.