responses: '200': description: Backend Response
'403': description: Unauthorized
'401': description: Unexpected error
if status code is 403 or 401:
return "errorInfo": string
url
/register
parameters
{
name: string
email: string
pwd: string
}
response
{
status: string #Fail or Success
token: string
}url
POST /token
parameters
{
token:string
}
response Only need statusCode
url
/register/confirm_url
parameters
{
email: string
url: string # url: string # generate by token, e.g. www.columbiaFresh/register/<token>
}url
/confirm/<token>
parameters
Noneresponse
{
uid: string,
email: string,
uname: string
}
url
/login
parameters
{
email: string
password: string
}
response
{
uid: string,
token: string,
email: string,
img: string,
uname: string
}url
GET /getRecipeTags
response
{
tags: [String]
}
url
GET /getIngredients
response
{
ingredients: [[String, String]] //ingredient type, ingredient unit
}
url
POST /createRecipe
postData
{
token: String,
title: String,
img: String,
tag: [String],
authorId: String, (userId Same),
description: String,
ingredients: [[String, String, String]], #iid, quantity, ?
directions: [String],
notes: String
}
response:
{
success: Bool (True/False)
msg: String
}
url
POST /deleteRecipe
postData
{
token: String,
rid: String
}
response:
{
msg: String
}
url
GET /hotMenu
response
{
menus: [string], list of menus
}
url
GET /page
parameters
{
query: string,
perPage: int
}
response
{
pages: int
}
url
GET /search
parameters
{
query: string,
page: int,
perPage: int
}
response
{
recipes: [{
rid: int, recipe id
url: '/recipe/'+id,
imgurl: string, image url
title: string, recipe name
author: string
likes: int,
ingredients: [{
name: string,
quantity: string
}],
}]
}
url
GET /rank
parameters
{
query: string, // empty
page: int,
perPage: int
}
response
{
recipes: [{
rid: int, recipe id
url: '/recipe/'+id,
imgurl: string, image url
title: string, recipe name
author: string
likes: int,
ingredients: [{
name: string,
quantity: string
}],
}]
}
url
POST /getRecipe
parameters
{
token: string,
uid: int, user id
rid: int, recipe id
}
response
{
rid: int,
title: string, recipe title
img: string, image url
likes: int,
isLiked: bool | false, whether user likes the recipe, default false
tags: [string],
aid: int, author uid
avatar: string, url of user avatar
author: string, username of author
discription: string,
calorie: int,
preptime: int, in min
ingredients: [{
name: string,
quantity: string
}],
directions: [string],
notes: string, footnote
}
url
POST /addToCart
parameters
{
token: string,
uid: int, user id
rid: int, recipe id
}
response
{
state: 'success'|'fail'
message: string
}
url
POST /likeRecipe
parameters
{
token: string,
uid: int, user id
rid: int, recipe id
like: bool
}
response
{
state: 'success'|'fail'
message: string,
likes: int,
isLiked: bool
}
url
POST /placeOrder
parameters
{
token: string,
uid: int, user id
}
response
{
orderId: string,
message: string
}
url
POST /orders
postData
data:
{
userId: string,
token: string
}
response
{
msg:[{
orderPlaceDate: string,
totalPrice: string,
shipTo: string,
orderID: string,
deliveredDate: string,
soldBy: string,
title: string,
img: string
}]
}
url
POST /getorder
postData
{
userId: string,
token: string,
orderId: string
}
response
date: string,
msg:[{
recipeId: string,
img: string,
title: string,
price: string, (single item price),
number: int,
item: [{
id: int,
img: string,
title: string,
price: float,
number: int
}]
}]}
url
POST /myrecipe/tags
postData
{
userId: string,
token: string
}
response
{
tag: [string]
}
url
POST /myrecipe/folder
postData
{
userId: String,
token: String,
tag: String
}
response
[{
id: String,
title: String,
src: String
}]
url
POST /shoppingCart
postData
{
userId: string,
token: string
}
response
{[{
recipeId: int,
img: string,
title: string,
price: float,
number: int,
ingredient:[{
id: int,
img: string,
title: string,
price: float,
number: int
}]
}]
}
url
POST /recipe/increasenum
postData
{
userId: string,
token: string,
rid: string
}
response
{
price: string
}
url
POST /recipe/decreasenum
postData
{
userId: string,
token: string,
rid: string
}
response
{
price: string
}
url
POST /deleteShoppingCartItem
postData
{
userId: string,
token: string,
rid: string
}
response
{
msg: "Success" | "fail"
}
url
POST /getfavouritelist
postData
{
userId: string,
token: string
}
response
[{
id: string,
title: string,
src: string
}]
url
POST /settings/basic
postData
{
token: string,
userId: string
}
response
{
firstname: string,
lastname: string,
gender: int,
email: string,
introduction: string, (token != userId)
userName: string (token != userId)
}
url
GET /getReputation?uid
parameters
{
uid: string
}
response
{
reputation: int, total likes
}
url
POST /settings/update/userIcon
postData
{
userId: string,
token: string,
img: string
}
reponse
{
msg: string
}
url
POST /settings/update/basic
postData
{
userId: string,
token: string,
firstname: string,
lastname: string,
gender: int,
email: string,
introduction: string
}
response
{
success: bool,
msg: string
}
url
POST /settings/update/password
postData
{
userId: string,
token: string,
oldPassword: string,
newPassword: string
}
response
{
success: bool,
msg: string
}
url
POST /settings/address
postData
{
userId: string,
token: string
}
response
{
streetAddress1: string,
streetAddress2: string,
city: string,
state_province_region: string
zipCode: string
}
url
POST /settings/update/address
postData
{
userId: xxxx,
token: string,
streetAddress1: string,
streetAddress2: string,
city: string,
state_province_region: string
zipCode: string
}
response
{
success: bool,
msg: string
}
url
POST /settings/getcredit
postData
{
userId: xxxx,
token: string
}
response
{
name: string,
cardNumber: string,
expirationMonth: string,
expirationYear:string,
cvv: string
}
url
POST /settings/update/credit
postData
{
userId: xxxx,
token: string,
name: string,
cardNumber: string,
expirationMonth: string,
expirationYear:string,
cvv: string
}
response
{
success: bool,
msg: string
}