hasLabels and label questions

50 views
Skip to first unread message

Fred Hannert

unread,
Jun 1, 2013, 11:30:10 AM6/1/13
to brewer...@googlegroups.com

1)  If there are "labels" in data can I assume there will always be 3 (large, medium, icon) ?
So either there will be no "labels" field returned or I will get something like this:
"labels":
                              {
                                     "icon":"http:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/cpgM4F\/upload_0dfehu-icon.png",
                                     "medium":"http:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/cpgM4F\/upload_0dfehu-medium.png",
                                     "large":"http:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/cpgM4F\/upload_0dfehu-large.png"
                              }

2) To check if there are labels or not can I just check for existence of "labels"  ?  I've tried a few and this seems to be the case.

3)  Also , How can I retrieve hasLabels ?  From the API doc it seems like hasLabels would work the same as isOrganic.  I have no issue with isOrganic.

I don't see it in then Json object.

I tried adding as a parameter but still I don't see it in then Json object.


Thanks!
Fred

Shaun Farrell

unread,
Jun 2, 2013, 9:22:48 AM6/2/13
to brewer...@googlegroups.com
Fred,

1. Yes if there is a label all three will be set.
2. Yes you can just check to see if labels exists.
3. hasLabels is used more as a filter to return beers with labels and beers without labels.  Example would be 

/beers?styleId=4&hasLabels=Y  <-- will return all beers with a styleId = 4 and have a label
/beers?styleId=4&hasLabels=N  <-- will return all beers with a styleId = 4 and do not have a label

Let us know if you have any other questions!

Cheers
--
You received this message because you are subscribed to the Google Groups "Brewery DB API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brewerydb-ap...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages