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

Can't update my locations address via API

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

I'm trying to update a location I manage through your api with patch. However, when I'm trying to update addressLines, I get address.country is a read-only field, I don't even have that included in my request. Please help. Attaching request body + header below:

 

Request body:

address:{addressLines: ["Malmöhus slott, Malmöhusvägen 6"]}

locationName:"Malmö Konstmuseum"

primaryPhone:"+46 (0)40-341000"

websiteUrl:"http://www.malmo.se/konstmuseum"

 

Fieldmask: locationName,websiteUrl,primaryPhone,address.addressLines

 

Error:

code:7

field:"address.country"

message:"field is read only"

 

NOTE: The location is not validated.

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by topic author Anton B
April

Can't update my locations address via API

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

Hey,

 

You'll find the solution in this thread. For some reason, you need to pass the country as a value even if you are not changing that element of the address.

 

https://www.en.advertisercommunity.com/t5/Google-My-Business-API/quot-address-country-field-is-read-...

Re: Can't update my locations address via API

Google Employee
# 3
Google Employee

Hi @Anton B,

 

We are looking into this and in the meantime please mention country field in your json body to avoid this error.

  

Thanks,

The Google My Business API team

Can't update my locations address via API

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thank you very much! Been stuck for some time now. 

 

Cheers.

Can't update my locations address via API

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Thank you Shalini! I worked it out thanks to Patrick, cheers.