beer_assets
The beer_assets
API retrieves a list of all of all static files associated with a particular beer. Any given beer may have zero or more such assets.
Parameters
- api_key (string) Required - The API key for the account
- id (integer) Required - The unique identifier for the beer. This may be retrieved from the
id
attribute of the beers API - last_updated_at (datetime) Optional - If this parameter is supplied, only assets whose last edited date is after the supplied date and time will be returned. The parameter should be formatted as "YYYY-MM-DD HH:MM:SS" and will be interpreted as a UTC date and time value.
Notes
The request must be formatted as https://dashboard.onpremisewine.com/beers/\<id>/assets.json
.
Response
The beer_assets
API returns a JSON array of assets. Each member of the array includes these attributes:
- id - Unique identifier.
- type - The type of file. See below for valid types.
- versions - An array of versions. Each version has an identifier and a URL from which the file can be retrieved.
- asset_content_type - MIME type of the file.
- asset_file_size - Size in bytes of the file.
- updated_at - The date that this file was last edited.
- processed - If
true
then the file is ready to download. - status - File status. A value of
0
indicates an active file. A value of1
indicates a deleted file. - original_url - URL of the original uploaded file. You cannot assume anything about the size of this file.
- beverage_id - The unique identifier of the beer to which this file belongs.
Asset file types
- WineLabelAsset - Label image
- WineMiscImageAsset - Miscellaneous image
- WineVideoAsset - Video file
Sample Request
https://dashboard.onpremisewine.com/beers/1001/assets.json?api_key=ABCDEF123456
Sample Response
{
"assets": [
{
"id": 1966,
"type": "WineLabelAsset",
"versions": {
"ipad_one_up_thumb": {
"url": "http://c448288.r88.cf2.rackcdn.com/uploads/beer_label_asset/61966/ipad_one_up_thumb_1135210_image.jpg"
},
"web_thumb": {
"url": "http://c448288.r88.cf2.rackcdn.com/uploads/beer_label_asset/61966/web_thumb_1135210_image.jpg"
},
"ipad_list": {
"url": "http://c448288.r88.cf2.rackcdn.com/uploads/beer_label_asset/61966/ipad_list_1135210_image.jpg"
}
},
"asset_content_type": "image/jpeg",
"asset_file_size": 8785,
"updated_at": "2011-09-10T12:43:04-07:00",
"processed": true,
"status": 0,
"original_url": "http://c448288.r88.cf2.rackcdn.com/uploads/beer_label_asset/61966/1135210_image.jpg",
"beverage_id": 1001
}
]
}