Last updated: 2019-04-02

​​​​​​​​Query endpoints for the drinkplatform


All of the query endpoints can be called with a Size parameter.
This parameter defines the amount of data in the response.
For example a drink that is requested default (without) the Size parameter, will only get a small set of data.
The three values that can be used for the Size parameter is: Small, Medium and Full.

Example of queries using the Size parameter:
https://api.absolutdrinks.com/drink/cosmopolitan?size=small
https://api.absolutdrinks.com/drink/cosmopolitan?size=medium
https://api.absolutdrinks.com/drink/cosmopolitan?size=full

The documentation does not have a specification for all sizes for the different entities at this moment.


https://api.absolutdrinks.com/drinks​/{query}​​

​This endpoint is the main endpoint used for querying drinks. It has all the functionality needed to query drinks.

​​

Defaul​​t beha​vior

The default behavior when querying against /drinks is to match by Name and Ingredient.​ If you do not explicitly specify a query, the default behavior will be used.

So for example, https://api.absolutdrinks.com/drinks/vodka, would query all drinks where the name contains vodka OR any of the ingredients in the drink contains vodka.​


The query may contain any of the following keywords.

​Not 

Not is the negating keyword and negates the keywords that comes after it. It will not negate the entire query. 

Example 1: https://api.absolutdrinks.com/drinks/name/cosmopolitan/not/colored/red return the drinks that has cosmopolitan in the name but NOT colored red.
Example 2: https://api.absolutdrinks.com/drinks/with/absolut-citron/not/name/cosmopolitan will return drinks containg Absolut Citron but not the drinks containing the name Cosmopolitan.

Is

​Is keyword is used to get the query linguistically​ more correct or readable. 

Example 1: https://api.absolutdrinks.com/drinks/is/alcoholic

Example 2: https://api.absolutdrinks.com/drinks/is/not/alcoholic

Both of the examples above makes the query more readable.


​Id​​​​​​

​Id keyword will match drinks with the exact id. It will not match on Id's containing parts of the Id, only exact match.


Name

Name keyword will match any name of drinks that contains the specified name.

Example 1: https://api.absolutdrinks.com/drinks/name/cosmo will return drinks where the name contains 'cosmo'

Example 2: https://api.absolutdrinks.com/drinks/name/absolut,cosmo will return drinks where the name contains 'absolut' OR 'cosmo'.​


Alias

Alias keyword​ will do a match for a drinks alias(es). The api will return drinks that either has the match on Alias property or the collection, Aliases, contains the specified alias.

Example 1: https://api.absolutdrinks.com/drinks/alias/cosmopolitan will return drinks where alias = cosmopolitan. 

It is possible to query for multiple drinks using alias at the same time, comma separate the aliases.

Example 2: https://api.absolutdrinks.com/drinks/alias/cosmopolitan,espresso-martini,bloody-mary will return drinks containing any of the three strings.

If you specify the querystring 'exactmatch=true' in the request, matching on alias will be done exact, otherwise the matching will be done where the alias on the drinks 'contains' the supplied string.

Example 3: https://api.absolutdrinks.com/drinks/alias/cosmopolitan,espresso-martini,bloody-mary?exactmatch=true


Doing / Action​

Querying using any of the 'doing' or 'action' keyword will search for drinks that contains an action with the followed string. 

Example: https://api.absolutdrinks.com/drinks/action/shake


Brand

Brand keyword is used when querying for drinks for a specific brand. 

This keyword has been deprecated. Use the query string parameter 'Brand' instead. 


Culture

Culture keywords is used when querying for drinks for a specific culture. 

This keyword is currently not in use, as in the current version the Culture property on drinks is not fully implemented/used.

This keyword is available in the api for future functionality. It will be possible to create drinks for specific cultures in the future.


With / Ingredient

​Both 'With' and 'Ingredient' keywords are used to query for drinks that contains the specified ingredient. 

Example 1: https://api.absolutdrinks.com/drinks/with/absolut-citron will return drinks that has Absolut Citron as ingredient.

Example 2: https://api.absolutdrinks.com/drinks/ingredient/absolut-citron will also return drinks that has Absolut Citron as ingredient.


WithType

The WithType keyword is used to query drinks with an ingredient type that matches the supplied string.

Example 1: https://api.absolutdrinks.com/drinks/withtype/vodka will return drinks that has an ingredienttype = vodka

There are a number of ingredient types available:


Alcoholic

The alcoholic keyword is used to query for drinks that are alcoholic or not. This is a boolean value and can negated using the Not keyword.

Example 1: https://api.absolutdrinks.com/drinks/alcoholic will return drinks that ARE alcoholic

Example 2: https://api.absolutdrinks.com/drinks/not/alcoholic will return drinks that are NOT alcoholic


Carbonated

The carbonated keyword is similar to the alcoholic keyword, it's a boolean value that when added to a query returns drinks that are carbonated. If the Not keyword is added before it, the query is negated.

Example 1: https://api.absolutdrinks.com/drinks/carbonated returns drinks that ARE carbonated.

Example 2: https://api.absolutdrinks.com/drinks/not/carbonated returns drinks that are NOT carbonated


Hot

The hot keyword is similar to both alcoholic and carbonated keyword. It's a boolean value that when added to a query returns drinks that are hot. If the Not keyword is added before it, the query is negated.

Example 1: https://api.absolutdrinks.com/drinks/hot returns drinks that ARE hot.

Example 2: https://api.absolutdrinks.com/drinks/not/hot returns drinks that are NOT hot.

Colored / Coloured

The colored/coloured keyword is used to query for drinks that is of a specific color. 

There are a number of colors available in the system:

Example 1: https://api.absolutdrinks.com/drinks/colored/red returns drinks that are of color red.

The color query matches if the color name contains the string or the alias matches the string exactly.


Language

The language keyword in used to query for drinks for a specific language.

This keyword has been deprecated. Use the query string parameter Language instead.

Example 1: https://api.absolutdrinks.com/drink/cosmopolitan?language=German will return Cosmopolitan in German.

Available languages are:


Market

Market keyword is used when querying for drinks for a specific market. 

This keyword is currently not in use, as in the current version of the platform the Market property on drinks is not fully implemented/used.

This keyword is still available in the api for future functionality. It will be possible to create drinks for specific markets in the future.


For / Occasion

The For and Occasion keyword is used to query for drinks for different occasions.

The match on occasion is made where the name of the occasion contains the supplied string or the alias matches the string exactly.

Example 1: https://api.absolutdrinks.com/drinks/for/christmas returns drinks where the occasion name contains christmas or the aliases matches 'christmas' exactly.

Example 2: https://api.absolutdrinks.com/drinks/for/dinner returns drinks where the occasion can be any of: 'Pre-dinner drinks' or 'After-dinner drinks'


In / ServedIn / Glass

Any of these keywords can be used to query for drinks that are served in a container/glass as the supplied string.

Example 1: https://api.absolutdrinks.com/drinks/in/cocktail-glass returns drinks that are served in a cocktail glass. 'cocktail-glass' is matched on alias in this case.

Example 2: https://api.absolutdrinks.com/drinks/glass/cocktail returns drink that are served in a container/glass where the name contains cocktail.


Skillevel / SkillLevel / Skill

Any of these keywords are used to query for drinks with a skillevel that matches the supplied string.

Example 1: https://api.absolutdrinks.com/drinks/skill/easy returns drinks where the skillevel equals 'easy'.

There are three skill levels:

Story

The story keyword can be used to query for drinks that has a matching story or the story contains the supplied the string.

Example 1: 'https://api.absolutdrinks.com/drinks/story/the famous espress' returns drinks that contains the string 'the famous espresso'. In this case Espresso Martini.


Taste / Tasting

Taste and Tasting keywords are used to query for drinks where the taste contains the supplied string.

Example 1: https://api.absolutdrinks.com/drinks/tasting/sweet returns drinks that has the taste Sweet.

Taste matches on both where the name of the taste contains the supplied string or the alias is an exact match.


Tool / Tools

The tool and tools keywords are used to query for drinks where a tool used in the mixing matches the supplied string.

Example 1: https://api.absolutdrinks.com/drinks/tool/knife returns drinks where a knife is needed as tool to make the drink.


Tag / Tags

The tag and tags keyword are used to query for drinks that has a tag value that contains the supplied string.

Example 1: https://api.absolutdrinks.com/drinks/tag/cosmopolitan returns drinks that has any tag value that contains 'cosmopolitan' 

As drinks can be tagged by any number of tags and by different types, tags can be used for many purposes. For example to group or categorize.


Find / Search

Find and Search keyword are used to query for drinks using all of the above keywords.
When using any of these keywords the matching for drinks will be performed on:
Name, Brand, Culture, Ingredient, Language, Market, Occasion, ServedIn, SkillLevel, Story, Taste and Tool.​

Example 1: https://api.absolutdrinks.com/drinks/find/cosmo

Example 2: https://api.absolutdrinks.com/drinks/search/cosmo


Image

Searching for drinks using image data can be done using two query levels. Either by '/drinks/image/type/{specificImage}' or '/drinks/image/tag/{tag}'

Image properties 'SpecificImage' and 'Tags' can be used when querying for drinks.


Rating

The rating keyword can be used to query for drinks, either above a certain rating or below.
By default, the rating keyword queries for drink above the supplied value. Example https://api.absolutdrinks.com/drinks/rating/50 would return drinks above a rating of 50.
You can explicitly say that the query should be for rating above using '/above/{rating}' or below using '/below/{rating}'

Example 1: https://api.absolutdrinks.com/drinks/rating/50 returns drinks that are rated above 50.

Example 2: https://api.absolutdrinks.com/drinks/rating/below/40 returns drinks that are rated below 40.


​When using most of the keywords and you want to do an OR query, you can comma separate values that you want to search for.

Example 1: https://api.absolutdrinks.com/drinks/with/orange,lemon,blueberry returns drinks that contains an ingredient that EITHER contains Orange, Lemon OR Blueberry.

It is also possible to query with an expression containing both OR and AND.

Example 2: https://api.absolutdrinks.com/drinks/with/orange,lemon,blueberry/not/with/orange juice returns drinks where the ingredient matches Orange, Lemon or Blueberry but NOT Orange Juice.

Example 3: https://api.absolutdrinks.com/with/orange/with/lemon returns drinks that contains both Orange AND Lemon in the ingredients.


Querystrings


IncludeAggregations

The querystring includeaggregations will return meta data for the request.
If set to 'true', data will be returned in the response with information of how many matches where found, the time it took to perform the query, aggregated data, url to get the 'next' request and more.

Example: https://api.absolutdrinks.com/drinks/red?includeaggregations=true

Take

The 'Take' querystring is the number of returned matches that you want. 
There is a limit at 100. So it is not possible to get more then 100 drinks at once. 
If you want more then 100, then you can run the query using includeaggregations and get the next url to retrieve next 100 drinks or run another query manually were you skip 100.

Example: https://api.absolutdrinks.com/drinks/a?take=100&skip=100

You cannot skip more then than the resulting drinks, then you will get a 204 (No Content) response.


Skip

Skip query string is the number of drinks you want to skip for the result.

Example: https://api.absolutdrinks.com/drinks/cosmopolitan?skip=1&take=1 will take the second drink that matches cosmopolitan.​


Language

The language query string is used to query for drinks for that specific language. 
If the language parameter is not supplied, the default will be English.

Available languages are:


Market​

​The market query string parameter is used to query for drinks for specific market(s).

This query string parameter is currently not available through the API. It has not been fully implemented.


Culture

The ​culture query string parameter is used to query for drinks for specific culture(s).

As the market parameter the culture parameter is currently not available through the API. It has not been fully implemented.


Brand

The brand query string parameter can be used to query for drinks for different brands. Only one brand can be queried for each request.


OrderBy

The OrderBy parameter is used to order the result from the query. The following parameters can be specified to order by:


SortOrder

​Sortorder is used to sort the result Ascending or Descending.

Specify sortorder=asc or sortorder=desc as a query parameter to apply the sortorder.

Default is Ascending


https://api.absolutdrinks.com/drink/{alias}​​

This endpoint is used when the alias of a drink is known and you want to get an exact hit and only one drink. 
This is the performance with best endpoint to use when the alias is known, even though it is possible to query for drinks using the alias (the endpoint described above).

Example 1: https://api.absolutdrinks.com/drink/cosmopolitan will return the Cosmopolitan drink.

The available query strings available for this endpoint are:

Language​​

​The language query string parameter is used to get the exact match for the supplied drink for the specific language.

Example: https://api.absolutdrinks.com/drink/cosmopolitan?language=German returns the Cosmopolitan in German.


Brand

​The brand query string parameter is used to get the exact match for the suppleid drink for the specific brand.

Example: https://api.absolutdrinks.com/drink/cosmopolitan?brand=Malibu returns the Cosmopolitan for the Malibu brand. (only for example, it does not exist)


IncludeRelatedDrinks​​

This query string parameter is used to include related drinks for the match in the response. In the response object it is a collection of drinks as 'RelatedDrinks' property.

Example: https://api.absolutdrinks.com/drink/cosmopolitan?includerelateddrinks=true returns the Cosmopolitan as result including the 10 nearest related drinks to Cosmopolitan.


IncludeNonAlcoholicRelatedDr​​inks

This query string parameter is used to include non alcoholic related drinks for the match in the response. In the response object, the non alcoholic related drinks are populated in the 'NonAlcoholicRelatedDrinks' property.

Example: https://api.absolutdrinks.com/drink/cosmopolitan?includenonalcoholicrelateddrinks=true returns the Cosmopolitan as result including the 10 nearest non alcoholic related drinks.


Take​​​​​

This query string defines that max number of result. 
It defaults to 10 and 100 is the maximum available in a response. If you specify a value higher then 100, the api will only return 100.


Skip​

This query is used to create pagination. Make sure to not set a Skip value higher then available drinks, otherwise you will get a 204 as status code.


https://api.absolutdrinks.com/drinks/like/{alias}​​​

This endpoint can be used to return drinks that are similar to the one supplied as alias. 
Related drinks are calculated using an algorithm and is based on similar ingredients, tastes, color and glass that it's served in. 

Example: https://api.absolutdrinks.com/drinks/like/cosmopolitan returns drinks that are related to Cosmopolitan.

This endpoint has the following query string parameters:

(See description of query string parameters above)


https://api.absolutdrinks.com/drinks/aggregations​

This endpoint can be used to get all aggregated data for the drinks that are currently available in the api.

Aggregated data contains the total number of drinks and aggregations grouped by:

By using this endpoint and looking at the different aggregations, you get data that can be used when querying for drinks. 

This endpoint has the following query string parameters:
(See description of query string parameters above)

​​

https://api.absolutdrinks.com/drinks/random/{query}

This endpoint takes a query and returns random drink(s) from the result.

​The "random" endpoint supports all of the same query parameters as the drinks query endpoint. See exact parameters above.

​​

https://api.absolutdrinks.com/drinks/count/{query}

This endpoint takes a query and returns the number of drinks that matches the query.

​The "count" endpoint supports all of the same query parameters as the drinks query endpoint. See exact parameters above.

​​

https://api.absolutdrinks.com/drinks/all/{query}

This endpoint takes a query and returns all drinks that matches the query.
There is no limit on this endpoint in regards to number of drinks returned in the response, though this endpoint is limited in the number of request made against it.
You are allowed a number of 10 request per each 10 minute intervall.

​The "random" endpoint supports all of the same query parameters as the drinks query endpoint. See exact parameters above.