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

Menu Attribute API

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

Hi,

 

Does anyone have an idea where are the details for the new api for changing the menu attribute URL ?

Can't seem to find them on 

https://developers.google.com/my-business/reference/rest/v3/AttributeValueType

 

Or is there some other page for this attribute ?

 

Regards,

1 Expert replyverified_user

Re: Menu Attribute API

[ Edited ]
Google Employee
# 2
Google Employee

Hi @Anubhav N,

 

We suggest you use attributes.list method to find all available attributes for your location with the given primary category and country. You can change the specific menu URL using UrlAttributeValue object of urlValues field for specified attribute of the location in Google My Business.

 

Thanks,

The Google My Business API team

Menu Attribute API

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

If the attribute is available for our category do we add the attribute to our location when we do a location patch?

 

Is there a field mask for attributes?

 

Thank you.

Re: Menu Attribute API

[ Edited ]
Google Employee
# 4
Google Employee

Hi @Jeremy M,

 

Yes, you can use the attributes fieldmask to update attributes for your category when you patch a location in the Google My Business API. Please checkout the given Request URI for fieldmask.  

 

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

 

Please note that it's best practice to always include a fieldMask for specific fields when you are updating a location to avoid overwriting data inadvertently.

 

Thanks,

Shalini

Menu Attribute API

[ Edited ]
Follower ✭ ✭ ☆
# 5
Follower ✭ ✭ ☆
"attributes": {
"attributeId": "url_menu",
"valueType": "URL",
"values": [],
"urlValues": [
"https:\/\/www.example_client.com\/menu\/to-go\/"
]
},

is giving me an error
{
"error": {
"code": 400,
"message": "Invalid value at 'location.attributes.url_values[0]' (type.googleapis.com/google.mybusiness.v3p1.UrlAttributeValue), \"https://www.example_client.com/menu/to-go/\"",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "location.attributes.url_values[0]",
"description": "Invalid value at 'location.attributes.url_values[0]' (type.googleapis.com/google.mybusiness.v3p1.UrlAttributeValue), \"https://www.example_client.com/menu/to-go/\""
}
]
}
]
}
}

Where am I going wrong?
The google category is gcid:restaurant and gcid:american_restaurant

Thanks for your advice

Menu Attribute API

Follower ✭ ✭ ☆
# 6
Follower ✭ ✭ ☆
{
"attributeId": "url_menu",
"valueType": "URL",
"urlValues": {
"url": "https:\/\/www.example_client.com\/menu\/to-go\/"
}
}

apparently the url string needs to be identified as a url. Currently it looks like only one menu link per location, is that correct?

Menu Attribute API

Follower ✭ ✭ ☆
# 7
Follower ✭ ✭ ☆

is there any way to add some granularity to this fieldMask like attribute.url_menu?  Other wise it seems to override everything.

Re: Menu Attribute API

Google Employee
# 8
Google Employee

Hi @Jeremy M,

 

No, if you will use the attributes fieldMask to update an attribute with valueType of URL when patching a location in the Google My Business API, it won’t overwrite the other values. Please note that it's best practice to always include a fieldMask for specific fields when you are updating a location to avoid overwriting data inadvertently.

 

Please checkout the given Request URI for the attributes fieldMask .  

 

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

 

{
"attributes": [
   {
     "urlValues": [
       {
         "url": "https://www.example_client.com/menu/to-go/"
       }
     ],
     "valueType": "URL",
     "attributeId": "url_menu"
   }
 ],
}

 

Please let us know if you have any other questions about Google My Business API. We are here to help.

 

Thanks,

The Google My Business API team

Menu Attribute API

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

How do I remove or clear 'url_menu' attribute?