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

Location Patch Request - 400 - Bad Request

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

Hi there,

 

We are having an issue with a Location Patch request, as follows:

 

PATCH /v3/accounts/109774580853871418555/locations/6328049915221868748?fieldMask=locationName,address.administrativeArea,address.postalCode,address.addressLines,address.locality,primaryPhone,websiteUrl,languageCode,primaryCategory,additionalCategories,regularHours,specialHours&languageCode=pt&validateOnly=false HTTP/1.1
Host: mybusiness.googleapis.com
Content-length: 1423
Content-type: application/json
Authorization: Bearer ya29.GlstBG-GeqOPhwfD0FZTM7KOIYtnsf21oWrE7dfNce6rOV2_Gb8n5jqy5dFgLtgI3aJCDS-2vrvTy_JaJqHXcxbBe4_vwLg8WxvKudfLDhHXjZwPwD2ZCRdTe3Jw
{
  "address": {
    "addressLines": [
      "E. N. 6 -  Av. Marginal, km 14"
    ],
    "administrativeArea": "Lisboa",
    "locality": "Cascais",
    "postalCode": "2775-239"
  },
  "languageCode": "pt",
  "locationName": "BP",
  "primaryCategory": {
    "categoryId": "gcid:gas_station",
    "name": "Gas Station"
  },
  "primaryPhone": "+351214647808",
  "regularHours": {
    "periods": [
      {
        "closeDay": "MONDAY",
        "closeTime": "23:59",
        "openDay": "MONDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "TUESDAY",
        "closeTime": "23:59",
        "openDay": "TUESDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "WEDNESDAY",
        "closeTime": "23:59",
        "openDay": "WEDNESDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "THURSDAY",
        "closeTime": "23:59",
        "openDay": "THURSDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "FRIDAY",
        "closeTime": "23:59",
        "openDay": "FRIDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "SATURDAY",
        "closeTime": "23:59",
        "openDay": "SATURDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "SUNDAY",
        "closeTime": "23:59",
        "openDay": "SUNDAY",
        "openTime": "00:00"
      }
    ]
  },
  "storeCode": "17154PT0",
  "websiteUrl": "http://www.bp.com/"
}

which results in a 400 Bad Request as follows:

 

HTTP/1.1 400 Bad Request
Content-length: 371
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
X-goog-trace-id: afbd543aed61f2a7c985e20adc6ba8c2
Transfer-encoding: chunked
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Fri, 14 Apr 2017 09:08:16 GMT
X-frame-options: SAMEORIGIN
Alt-svc: quic=":443"; ma=2592000; v="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", 
            "code": 1100
          }
        ], 
        "@type": "type.googleapis.com/google.mybusiness.v3p1.ValidationError"
      }
    ]
  }
}

As you can see, we don't send the address.country nor setting the mask for, yet the result is as mentioned above.

We tested it from java client and the OAuth 2.0 Playground, bot resulting in the same error, and the only way to get rid of such an error is to exclude all the address field from the request and of course the mask too.

 

We also tried sending the address.country in the request without mentioning it in the mask, as the result was the same:

PATCH /v3/accounts/109774580853871418555/locations/6328049915221868748?fieldMask=locationName,address.administrativeArea,address.postalCode,address.addressLines,address.locality,primaryPhone,websiteUrl,languageCode,primaryCategory,additionalCategories,regularHours,specialHours&languageCode=pt&validateOnly=false HTTP/1.1
Host: mybusiness.googleapis.com
Content-length: 1444
Content-type: application/json
Authorization: Bearer ya29.GlstBG-GeqOPhwfD0FZTM7KOIYtnsf21oWrE7dfNce6rOV2_Gb8n5jqy5dFgLtgI3aJCDS-2vrvTy_JaJqHXcxbBe4_vwLg8WxvKudfLDhHXjZwPwD2ZCRdTe3Jw
{
  "address": {
    "addressLines": [
      "E. N. 6 -  Av. Marginal, km 14"
    ],
    "administrativeArea": "Lisboa",
    "country": "PT",
    "locality": "Cascais",
    "postalCode": "2775-239"
  },
  "languageCode": "pt",
  "locationName": "BP",
  "primaryCategory": {
    "categoryId": "gcid:gas_station",
    "name": "Gas Station"
  },
  "primaryPhone": "+351214647808",
  "regularHours": {
    "periods": [
      {
        "closeDay": "MONDAY",
        "closeTime": "23:59",
        "openDay": "MONDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "TUESDAY",
        "closeTime": "23:59",
        "openDay": "TUESDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "WEDNESDAY",
        "closeTime": "23:59",
        "openDay": "WEDNESDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "THURSDAY",
        "closeTime": "23:59",
        "openDay": "THURSDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "FRIDAY",
        "closeTime": "23:59",
        "openDay": "FRIDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "SATURDAY",
        "closeTime": "23:59",
        "openDay": "SATURDAY",
        "openTime": "00:00"
      },
      {
        "closeDay": "SUNDAY",
        "closeTime": "23:59",
        "openDay": "SUNDAY",
        "openTime": "00:00"
      }
    ]
  },
  "storeCode": "17154PT0",
  "websiteUrl": "http://www.bp.com/"
}

Any ideas? Are we missing something?!

1 Expert replyverified_user

Location Patch Request - 400 - Bad Request

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Any feedback guys? 

Location Patch Request - 400 - Bad Request

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Same problem here would be good to have some feedback

Re: Location Patch Request - 400 - Bad Request

Google Employee
# 4
Google Employee

Hi @Sevan E & @Ani A,

 

We are investigating your issue and will get back to you with a response soon. Thanks for your patience!

 

Thanks,

The Google My Business API team

Location Patch Request - 400 - Bad Request

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi @shalini

Any news?

Location Patch Request - 400 - Bad Request

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Hi @Shalini S,

It's been 3 months now, any news or update?

Because of this issue lots of manual work is being done, would you mind give me an update?

 

Regards

Experts in the Topic
Shalini S