AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

address.country is required when updating phone number

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

Hello, we are trying to send a PATCH command to update a location, but we are getting an error.

 

PATCH https://mybusiness.googleapis.com/v3/accounts/105723269212032067249/locations/16235288234369035170

BODY

{"primaryPhone":"+390549886111","locationName":"Test Livein GB","primaryCategory":{"name":"Provider di servizi per le telecomunicazioni","categoryId":"gcid:telecommunications_service_provider"}}

RESPONSE:

 

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError",
        "errorDetails": [
          {
            "code": 2,
            "field": "address.country",
            "message": "address.country is required"
          }
        ]
      }
    ]
  }
}

Why do we need to specify address country to update phone number?

 

Anyway, even if we specify the address.country field, we get another error:

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

How can we proceed?


Thanks

 

 

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Simone F
August 2017

Re: address.country is required when updating phone number

Google Employee
# 2
Google Employee

Hi @Simone F,

 

Judging from the source code you provided, I notice that you are missing couple of parameters in your code when updating the location. You didn’t include query parameters in your request URI.

 

We suggest you add the query parameters when you patch a location via the Google My Business API. Please checkout the given Request URI:

 

PATCH https://mybusiness.googleapis.com/v3/accounts/account_name/locations/locationId?languageCode=en&validateOnly=false&fieldMask=primaryPhone,locationName

 

I hope this helps!

 

Thanks,

Shalini, The Google My Business API team

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Simone F
August 2017

Re: address.country is required when updating phone number

Google Employee
# 2
Google Employee

Hi @Simone F,

 

Judging from the source code you provided, I notice that you are missing couple of parameters in your code when updating the location. You didn’t include query parameters in your request URI.

 

We suggest you add the query parameters when you patch a location via the Google My Business API. Please checkout the given Request URI:

 

PATCH https://mybusiness.googleapis.com/v3/accounts/account_name/locations/locationId?languageCode=en&validateOnly=false&fieldMask=primaryPhone,locationName

 

I hope this helps!

 

Thanks,

Shalini, The Google My Business API team