Skip to content

RESTful Services Documentation

brimless edited this page Feb 28, 2022 · 19 revisions

Drinks Service

Request Type Method Description Endpoints Inputs Outputs
POST 'createDrink' /drinks/add name:String
tag:enum
public_status:Boolean
author:String
rating:Number
recipe:recipeSchema
Creates a drink of type Drink.
POST 'createRecipe' /drinks/add/recipe ingredients:[ingredientSchema]
garnish:String
instruction:String
Creates a recipe.
POST 'createIngredient' /drinks/add/ingredient ingredientName:String
ingredientType: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:String
rating: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:String
public_status:String
Changes the status of a drink (public or private).
PUT 'addIngredient' /drinks/:username/:name/update/ingredient username:String
ingredientName:String
ingredientType:enum
Adds an ingredient to an existing drink recipe.
PUT 'removeIngredient' /drinks/:username/:name/remove/ingredient username:String
ingredientName:String
Removes an ingredient from an existing drink recipe.

User Service

Request Type Method Description Endpoints Inputs Outputs
POST 'createUser' /users/register username:String
password:String
email:String
Creates a new user in the system with username, password and email of type String
POST 'login' /users/login username:String
password: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:String
password:String
newPassword:String
confirmNewPassword:String
Updates user password given the password is correct and the new password and the confirmation password match.

Admin Service

Request Type Method Description Endpoints Inputs Outputs
POST 'createUser' /users/register username:"admin"
password:String
email:String
Creates an admin account
POST 'login' /users/login username:String
password: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:String
isAdmin:Boolean
Deletes any given drink in the system.

Clone this wiki locally