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

Errors patching with an attribute within the list of available attributes

[ Edited ]
Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Hi,

 

We're trying to patch locations and we'd like to update the attributes of the location.

To fetch the list of available attributes, we're making this request:

## get all attributes
curl "https://mybusiness.googleapis.com/v3/attributes?name=accounts%2F117524948641077217237%2Flocations%2F1036281077058933555" \
     -H "Authorization: Bearer REDACTED"

This request responds with the list of attributes, among which we also see 

…
        {
            "attributeId": "has_delivery",
            "valueType": "BOOL",
            "displayName": "Delivery",
            "groupDisplayName": "Dining options",
            "valueMetadata": [
                {
                    "value": true,
                    "displayName": "Delivery"
                }
            ]
        },
…

(the full response is here: https://gist.github.com/asheshambasta/f779e9e5ba5bd98418148e77d23477ef#file-attributes-json-L400)

 

Now, since this attribute is present in the list of available attributes, we're including in our patch request.

We then get an error that has us stumped:

 

{
  "code": "400",
  "type": "INVALID_ARGUMENT",
  "message": "Request contains an invalid argument.",
  "can_ignore": false,
  "error_details": {
    "type.googleapis.com/google.mybusiness.v3p1.ValidationError": [
      {
        "code": "3",
        "field": "attributes",
        "message": "Attribute not valid for this location",
        "value": "has_delivery"
      }
    ]
  }
}

Is this expected? If this is, what can we use as an authoritative list of attributes to push for a location?

1 Expert replyverified_user

Errors patching with an attribute within the list of available attributes

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

(note: at the time of posting this, the category of the place was set to gcid:bar)

Errors patching with an attribute within the list of available attributes

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

Hi,

 

This issue is getting quite urgent for us. Can anyone please confirm how to proceed about this?

We're seeing issues with attempting to edit for multiple attributes that are included in the list of available attributes for that Business. 

 

Thanks.

Re: Errors patching with an attribute within the list of available attributes

Google Employee
# 4
Google Employee

Hi @Ashesh A,

 

No, attributes are based on location category and country, you cannot add attributes not listed in the GetAttributes call.

 

The error you posted indicates that the attribute you are trying to add is not valid for your location. Please note, if your business serves customers at their locations, you should list it as a service area business on Google.

 

I hope this helps!

 

Thanks,

The Google My Business API team