-
Notifications
You must be signed in to change notification settings - Fork 1
RESTful Services Documentation
brimless edited this page Feb 28, 2022
·
19 revisions
| Request Type | Method Description | Endpoints | Inputs | Outputs |
|---|---|---|---|---|
POST |
'createDrink' | /drinks/add |
name:Stringtag:enumpublic_status:Booleanauthor:Stringrating:Numberrecipe:recipeSchema
|
Creates a drink of type Drink. |
POST |
'createRecipe' | /drinks/add/recipe |
ingredients:[ingredientSchema]garnish:Stringinstruction:String
|
Creates a recipe. |
POST |
'createIngredient' | /drinks/add/ingredient |
ingredientName:StringingredientType:enum
|
Creates an ingredient. |
GET |
'getAllDrinksRating' | /drinks/:username/r |
username:String |
All the drinks sorted by ratings (high to low) from a user's perspective. |
GET |
'getAllDrinksAlpha' | /drinks/:username/a |
username:String |
All the drinks sorted by alphabetical order from a user's perspective. |
GET |
'getAllDrinksNewest' | /drinks/:username/n |
username:String |
All the drinks sorted by newest from a user's perspective. |
GET |
'getPersonalCustomDrinks' | /drinks/:username/custom |
username:String |
All the user's custom drinks. |
GET |
'getAllDrinksAboveRating' | /drinks/:username/ra/:rating |
username:Stringrating:Integer
|
All the drinks above a certain rating threshold from a user's perspective. |
GET |
'getDrinksByUser' | /drinks/:username |
username:String |
All the drinks made by a certain user. |
GET |
'getDrinkByName` | /drinks/:name/name |
name:String |
Public drinks with that name. |
GET |
'getDrinkByTag' | /drinks/tag/:tag |
tag:enum |
Public drinks with that tag. |
GET |
'getDrinkByIngredient' | /drinks/filter/ingredients |
ingredients:[ingredientName] |
All drinks that contain any of these ingredients |
PUT |
'changeStatus' | /drinks/:username/:name/update/status |
username:Stringpublic_status:String
|
Changes the status of a drink (public or private). |
PUT |
'addIngredient' | /drinks/:username/:name/update/ingredient |
username:StringingredientName:StringingredientType:enum
|
Adds an ingredient to an existing drink recipe. |
PUT |
'removeIngredient' | /drinks/:username/:name/remove/ingredient |
username:StringingredientName:String
|
Removes an ingredient from an existing drink recipe. |
| Request Type | Method Description | Endpoints | Inputs | Outputs |
|---|---|---|---|---|
POST |
'createUser' | /users/register |
username:Stringpassword:Stringemail:String
|
Creates a new user in the system with username, password and email of type String
|
POST |
'login' | /users/login |
username:Stringpassword:String |
Logs the user in their account with username and password of type String
|
GET |
'logout' | /users/logout |
Logs the user out of their account | |
GET |
'getUserByUsername' | /user/:username |
username:String |
Finds user with that username |
PUT |
'updatePassword' | /user/:username/update |
username:Stringpassword:StringnewPassword:StringconfirmNewPassword:String
|
Updates user password given the password is correct and the new password and the confirmation password match. |
| Request Type | Method Description | Endpoints | Inputs | Outputs |
|---|---|---|---|---|
POST |
'createUser' | /users/register |
username:"admin"password:Stringemail:String
|
Creates an admin account |
POST |
'login' | /users/login |
username:Stringpassword:String |
Logs the admin in their account with username and password of type String
|
GET |
'logout' | /users/logout |
Logs the admin out of their account | |
DELETE |
'removeDrink' | /drinks/:username/delete |
name:StringisAdmin:Boolean
|
Deletes any given drink in the system. |