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

Getting field error from API when submitting "US" in the address.country field

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

I've been using the Google My Business API regularly for some time now with no problems. Yesterday, I suddenly began getting an error for submissions for a certain location (the other 1100 or so I'm managing continue to work fine). The error says that I'm submitting an invalid argument, and it points to the address.country field. The content of that field in my submission is "US", and the address for the location I am submitting is in Pennsylvania. Here is the error:

 

{

  "error": {

    "code": 400,

    "message": "Request contains an invalid argument.",

    "status": "INVALID_ARGUMENT",

    "details": [

      {

        "@type": "type.googleapis.com/google.mybusiness.v3.ValidationError",

        "errorDetails": [

          {

            "code": 1100,

            "field": "address.country"

          }

        ]

      }

    ]

  }

}

 

My other locations are also located in the United States, and I submit all my other location information to the API in the same way as for this one, so why does this one throw an error?

1 Expert replyverified_user

Re: Getting field error from API when submitting "US" in the address.country field

Google Employee
# 2
Google Employee

Hi @Max C,

 

I suggest you follow the Make a simple HTTP request step-by-step guide on the documentation website to learn how to use the OAuth 2.0 Playground for troubleshooting errors with detailed error messages when sending requests with data via the Google My Business API.

 

The 400 Bad Request error with the error code 1100 and the message "We cannot locate the specified address. Please verify it is correct and/or drag the marker pin on the provided map to the correct location." typically happens when the system cannot geocode the specified address. You can provide the correct latitude/longitude values in a LatLng object when creating a new location via the API to fix this error. Please note that the latlng field is read-only and cannot be updated. Please also note that once you set your listing's country, you won't be able to change it in the future.

 

If you have already created the location and you are sending a PATCH request to update the location via the API, please use a fieldMask and confirm that the fieldMask does not include address and latlng. You can fix this geocode error through the Google My Business UI. Please read this article that includes the description of this specific error message and what you can do to fix this error and activate your listing.

 

Thanks,

Terry

Re: Getting field error from API when submitting "US" in the address.country field

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
@Terry W, I don't see "Google My Business API" listed in OAuth 2.0 Playground as one of the API's. Can you help?

Re: Getting field error from API when submitting "US" in the address.country field

Google Employee
# 4
Google Employee

Hi @Jayesh G

 

Please follow the Make a simple HTTP request step-by-step guide on the Google Developers site to learn how to use the OAuth 2.0 Playground to experiment with the Google My Business API. Under Step 1 Select & authorize APIs, you should enter the below scope for the Google My Business API and Click Authorize APIs:

https://www.googleapis.com/auth/plus.business.manage

 

Thanks,

Terry