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

Problem retrieving available attributes

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

Hi,

 

I'm using the Google APIs MyBusiness v3 C# library.

 

I'm attempting to retrieve a list of available attributes for a variety of Categories, but the method call only seems to require a Location, and so only retrieves attributes for that particular location.  Though I can set the CategoryId, and Country properties on the request, they appear to be ignored.

 

I assume I'm doing something wrong.

 

Thanks.

 

-Chris

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Chris M
October 2016

Problem retrieving available attributes

[ Edited ]
Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

I believe the call to get a list of attributes based on a given category is

 

https://mybusiness.googleapis.com/v3/attributes?categoryId=gcid:restaurant&languageCode=en

 

Executing that get request resulted in a payload (which I've trimmed). Not sure if that helps but hopefully it does.

 

{
 
"attributes": [
   
{
     
"groupDisplayName": "Offerings",
     
"displayName": "Afternoon tea",
     
"valueType": "BOOL",
     
"attributeId": "serves_afternoon_tea",
     
"valueMetadata": [
       
{
         
"displayName": "Afternoon tea",
         
"value": true
       
}
     
]
   
},
   
{
     
"groupDisplayName": "Offerings",
     
"displayName": "Alcohol",
     
"valueType": "BOOL",
     
"attributeId": "serves_alcohol",
     
"valueMetadata": [
       
{
         
"displayName": "Alcohol",
         
"value": true
       
},
       
{
         
"displayName": "No alcohol",
         
"value": false
       
}
     
]
   
},
   
{
     
"groupDisplayName": "Offerings",
     
"displayName": "All you can eat",
     
"valueType": "BOOL",
     
"attributeId": "has_all_you_can_eat_always",
     
"valueMetadata": [
       
{
         
"displayName": "All you can eat",
         
"value": true
       
}
     
]
   
},

 

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Chris M
October 2016

Problem retrieving available attributes

[ Edited ]
Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

I believe the call to get a list of attributes based on a given category is

 

https://mybusiness.googleapis.com/v3/attributes?categoryId=gcid:restaurant&languageCode=en

 

Executing that get request resulted in a payload (which I've trimmed). Not sure if that helps but hopefully it does.

 

{
 
"attributes": [
   
{
     
"groupDisplayName": "Offerings",
     
"displayName": "Afternoon tea",
     
"valueType": "BOOL",
     
"attributeId": "serves_afternoon_tea",
     
"valueMetadata": [
       
{
         
"displayName": "Afternoon tea",
         
"value": true
       
}
     
]
   
},
   
{
     
"groupDisplayName": "Offerings",
     
"displayName": "Alcohol",
     
"valueType": "BOOL",
     
"attributeId": "serves_alcohol",
     
"valueMetadata": [
       
{
         
"displayName": "Alcohol",
         
"value": true
       
},
       
{
         
"displayName": "No alcohol",
         
"value": false
       
}
     
]
   
},
   
{
     
"groupDisplayName": "Offerings",
     
"displayName": "All you can eat",
     
"valueType": "BOOL",
     
"attributeId": "has_all_you_can_eat_always",
     
"valueMetadata": [
       
{
         
"displayName": "All you can eat",
         
"value": true
       
}
     
]
   
},

 

Re: Problem retrieving available attributes

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks!  Once I adjusted my code to only include those two parameters (categoryId and languageCode), my code worked fine.

Problem retrieving available attributes

Follower ✭ ✭ ☆
# 4
Follower ✭ ✭ ☆

Good to hear!