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.4K members online now
1.4K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

400 Bad Request with V3 Location Patch

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

Hi Team,

We have recently migrated from V2 to V3 ,C# GMB library.

When trying to execute patch request we are getting following error


   
"status": "INVALID_ARGUMENT",
   
"message": "Request contains an invalid argument.",
   
"code": 400,
   
"details": [
     
{
       
"errorDetails": [
         
{
           
"field": "address.country",
           
"message": "address.country is required",
           
"code": 2
         
}
        

       
"type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError"

 

We are definitely passing the Country field, is there any change with V3 on address fields?

 

Thanks,

Sabir

1 Expert replyverified_user

Re: 400 Bad Request with V3 Location Patch

Google Employee
# 2
Google Employee

Hi @Sabir A,

 

Please provide us with the the specific locationId for the location and the full HTTP request message of the PATCH request including the URI, query parameters, and the JSON payloads of request body as well as the response body for triggering this error so that we can help you troubleshoot this issue further.

 

Thanks,

The Google My Business API Team

Re: 400 Bad Request with V3 Location Patch

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Shalini,

I am using oAuth2.0 playground and I am passing following URI

https://mybusiness.googleapis.com/v3/accounts/110354133002809671740/locations/4667192504989123571

 

And we are getting following response

HTTP/1.1 400 Bad Request
Content-length: 422
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Transfer-encoding: chunked
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Mon, 31 Jul 2017 03:31:02 GMT
X-frame-options: SAMEORIGIN
Alt-svc: quic=":443"; ma=2592000; v="39,38,37,36,35"
Content-type: application/json; charset=UTF-8
{
 
"error": {
   
"status": "INVALID_ARGUMENT",
   
"message": "Request contains an invalid argument.",
   
"code": 400,
   
"details":
     
{
       
"errorDetails":
         
{
           
"field": "address.country",
           
"message": "address.country is required",
           
"code": 2
         
}
       
,
       
"type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError"
     
}
   

 
}
}

Re: 400 Bad Request with V3 Location Patch

Google Employee
# 4
Google Employee

Hi @Sabir A,

 

Could you please provide the query parameters and the JSON payloads of request body as well so that we can help you troubleshoot this issue further.

 

Thanks,

Shalini, The Google My Business API team

Re: 400 Bad Request with V3 Location Patch

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Shalini,

I am sending Language code and  Validate only parameter , and not sending Field Mask parameter.

As we want to update all the fields.

When I am trying to pass  Field Mask parameter it seems the Location ID is updating fine, I am getting error only in case of not passing FieldMask.

 

 

Thanks,

Sabir

Re: 400 Bad Request with V3 Location Patch

Google Employee
# 6
Google Employee

Hi @Sabir A,

 

It is always recommended to add fieldMask when you patch a location via the Google My Business API.

 

Thanks,

The Google My Business API Team