Â
LINK : https://documenter.getpostman.com/view/24388906/2s8Yt1qocp
Â
BASE URL : https://foodise-back-end.deta.dev/
Request :
- Method : POST
- Endpoint :
(base-url)/auth/signup
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "email": "string", "username": "string", "gender" : "string, enum('perempuan','laki-laki')", "tinggi" : "number", "berat" : "number", "umur" : "number", "password" : "string", "levelAktivitas" : "number" }
- Authentication - Bearer Token :
<token key>
Response :
{
"message": "success",
"token": "string",
"username": "string",
"email": "string",
"gender": "string",
"password": "string encrypt",
"tinggi": "number",
"berat": "number",
"umur": "number",
"levelAktivitas": {
"val": "number",
"ket": "string"
},
"caloriNeeded": "number",
"carboNeeded": "number",
"proteinNeeded": "number",
"fatNeeded": "number"
}
Request :
- Method : POST
- Endpoint :
(base-url)/auth/signin
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "email": "string", "password": "string", }
- Authentication - Bearer Token :
<token key>
Response :
{
"message": "login success, welcome!",
"token": "string",
"username": "string",
"email": "string",
"gender": "string",
"password": "string encrypt",
"tinggi": "number",
"berat": "number",
"umur": "number",
"levelAktivitas": {
"val": "number",
"ket": "string"
},
"caloriNeeded": "number",
"carboNeeded": "number",
"proteinNeeded": "number",
"fatNeeded": "number"
}
Request :
- Method : POST
- Endpoint :
(base-url)/admin/signin
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "email": "foodise@gmail.com", "password": "foodise123", }
- Authentication - Bearer Token :
<token key>
Response :
{
"message": "login admin success, welcome !",
"token": "string",
"email": "foodise@gmail.com",
"password": "string encrypt"
}
Â
Request
- Method : GET
- Endpoint :
(base-url)/foods
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"name": "string",
"image": "string",
"category": {
"_id": "string unique",
"name": "string"
},
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
}
]
Request :
- Method : GET
- Endpoint :
(base-url)/foods/{:food_id}
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"name": "string",
"image": "string",
"category": {
"_id": "string unique",
"name": "string"
},
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
}
]
Request :
- Method : GET
- Endpoint :
(base-url)/foods/category/{:category_id}
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"name": "string",
"image": "string",
"category": {
"_id": "string unique",
"name": "string"
},
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"desc": "string",
"carbon": "number",
"createdAt": "date",
"updatedAt": "date"
}
]
Request :
- Method : GET
- Endpoint :
(base-url)/foods/search?name={:query}
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"name": "string",
"image": "string",
"category": {
"_id": "string unique",
"name": "string"
},
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
}
]
Request :
- Method : POST
- Endpoint :
(base-url)/foods
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
[ { "name":"string ", "image": "string", "category":"string unique", "cal": "number", "protein": "number", "carb": "number", "fat": "number", "carbon": "number", "desc": "string", }, { "name":"string", "image": "string", "category":"string unique", "cal": "number", "protein": "number", "carb": "number", "fat": "number", "carbon": "number", "desc": "string", } ]
Response :
{
"message": "food added successfully",
"data": [
{
"name":"string ",
"image": "string",
"category":"string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
},
{
"name":"string",
"image": "string",
"category":"string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
}
]
}
Request :
- Method : PATCH
- Endpoint :
(base-url)/foods/{:food_id}
- Header :
- Content-Type : application/json
- Accept : application/json
- Body : (example)
{ "cal": "number", "protein": "number", "carb": "number", "fat": "number", "carbon": "number", }
Response :
{
"message": "update success",
"foodUpdated": {
"acknowledged": true,
"modifiedCount": 1,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
}
}
Â
Request :
- Method : GET
- Endpoint :
(base-url)/recipes
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"portion": "number",
"healthScore": "number",
"overview": "string",
"ingredient": [ "string" ],
"timeServing": "number",
"food": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
},
"createdAt": "date",
"updatedAt": "date"
},
]
Request :
- Method : GET
- Endpoint :
(base-url)/recipes/{:recipe_id}
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"portion": "number",
"healthScore": "number",
"overview": "string",
"ingredient": [ "string" ],
"timeServing": "number",
"food": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
},
"createdAt": "date",
"updatedAt": "date"
},
]
Request :
- Method : GET
- Endpoint :
(base-url)/recipes/food/{:food_id}
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"portion": "number",
"healthScore": "number",
"overview": "string",
"ingredient": [ "string" ],
"timeServing": "number",
"food": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
},
"createdAt": "date",
"updatedAt": "date"
},
]
Request :
- Method : POST
- Endpoint :
(base-url)/recipes
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "portion": "number", "healthScore": "number", "overview": "string", "ingredient": ["string"], "timeServing": "number", "food": "string unique" }
Response :
{
"message": "resep added successfully",
"data": {
"portion": "number",
"healthScore": "number",
"overview": "string",
"ingredient": ["string"],
"timeServing": "number",
"food": "string unique"
}
}
Request :
- Method : PATCH
- Endpoint :
(base-url)/recipes/{:recipe_id}
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "portion": "number", "healthScore": "number", "overview": "string", "ingredient": ["string"], "timeServing": "number", "food": "string unique" }
Response :
{
"message": "resep added successfully",
"data": {
"portion": "number",
"healthScore": "number",
"overview": "string",
"ingredient": ["string"],
"timeServing": "number",
"food": "string unique"
}
}
Request :
- Method : GET
- Endpoint :
(base-url)/categories
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"name": "string"
}
]
Request :
- Method : POST
- Endpoint :
(base-url)/categories
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "_id": "string", "name":"string" }
Response :
{
"message": "category added successfully",
"data": {
"_id": "string",
"name": "string"
}
}
Request :
- Method : POST
- Endpoint :
(base-url)/favorites
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "user":"string unique", "food":"string unique" }
Response :
{
"message": "favorite food data added successfully",
"favorite": "string unique",
"newFav" : {
"user": "string unique",
"food": "string unique"
}
}
Request :
- Method : GET
- Endpoint :
(base-url)/favorites
- Header :
- Accept : application/json Response :
[
{
"_id": "string unique",
"user": "string unique",
"food": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "string",
"createdAt": "date",
"updatedAt": "date"
},
}
]
Request :
- Method : DELETE
- Endpoint :
(base-url)/favorites/{:favorite_id}
- Header :
- Accept : application/json Response :
{
"message": "favorite food data deleted successfully"
}
Request :
- Method : POST
- Endpoint :
(base-url)/tracking
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{
"food": [
{
"foodId": "string unique",
"portion": "number"
}
]
}
Response :
{
"_id": "string unique",
"user": "string unique",
"tracking": {
"date": "date",
"food": [
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
}
]
},
"totCarb": "number",
"totProtein": "number",
"totFat": "number",
"totCal": "number",
"totCarbon": "number"
}
Request :
- Method : GET
- Endpoint :
(base-url)/tracking
- Header :
- Accept : application/json Response :
{
"_id": "string unique",
"user": "string unique",
"tracking": {
"date": "date",
"food": [
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
},
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
}
]
},
"totCarb": "number",
"totProtein": "number",
"totFat": "number",
"totCal": "number",
"totCarbon": "number"
}
Request :
- Method : GET
- Endpoint :
(base-url)/tracking/today
- Header :
- Accept : application/json Response :
{
"_id": "string unique",
"user": "string unique",
"tracking": {
"date": "date",
"food": [
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
},
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
}
]
},
"totCarb": "number",
"totProtein": "number",
"totFat": "number",
"totCal": "number",
"totCarbon": "number"
}
Request :
- Method : GET
- Endpoint :
(base-url)/tracking/{:date}
- Header :
- Accept : application/json Response :
{
"_id": "string unique",
"user": "string unique",
"tracking": {
"date": "date",
"food": [
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
},
{
"foodId": {
"_id": "string unique",
"name": "string",
"image": "string",
"category": "string unique",
"cal": "number",
"protein": "number",
"carb": "number",
"fat": "number",
"carbon": "number",
"desc": "100gram"
},
"portion": "number",
"time": "time"
}
]
},
"totCarb": "number",
"totProtein": "number",
"totFat": "number",
"totCal": "number",
"totCarbon": "number"
}
Request :
- Method : GET
- Endpoint :
(base-url)/profile
- Header :
- Accept : application/json Response :
{
"_id": "string",
"username": "string",
"email": "string",
"gender": "string",
"password": "string encrypted",
"tinggi": "number",
"berat": "number",
"levelAktivitas": {
"val": "number",
"ket": "string"
},
"umur": "number",
"caloriNeeded": "number",
"proteinNeeded": "number",
"fatNeeded": "number",
"carboNeeded": "number",
"createdAt": "date",
"updatedAt": "date"
}
Request :
- Method : PUT
- Endpoint :
(base-url)/profile
- Header :
- Content-Type : application/json
- Accept : application/json
- Body : (example)
{ "username": "string", "gender": "string", "tinggi": "number", "berat": "number", "levelAktivitas": "number", "umur": "number" }
Response :
{
"message": "profile has been changed successfully",
"changeSuccess": {
"username": "string",
"gender": "string",
"tinggi": "number",
"berat": "number",
"umur": "number",
"levelAktivitas": "number",
"caloriNeeded": "number",
"carboNeeded": "number",
"proteinNeeded": "number",
"fatNeeded": "number"
}
}
Request :
- Method : PUT
- Endpoint :
(base-url)/profile/account
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{ "email": "string", "currentPassword": "string", "newPassword": "string", "confirmPassword": "string" }
Response :
{
"message": "string",
"changed": {
"email": "string",
"password": "string encrypted"
}
}
Request :
- Method : PUT
- Endpoint :
(base-url)/profile/change-password
- Header :
- Content-Type : application/json
- Accept : application/json
- Body : (example)
{ "currentPassword":"string", "newPassword":"string", "confirmPassword":"string" }
Response :
{
"message": "Password have been Changed successfully",
"success": {
"_id": "string",
"username": "string",
"email": "string",
"gender": "string",
"password": "string encrypted",
"tinggi": "number",
"berat": "number",
"levelAktivitas": "number",
"umur": "number",
"caloriNeeded": "number",
"proteinNeeded": "number",
"fatNeeded": "number",
"carboNeeded": "number",
"createdAt": "date",
"updatedAt": "date"
}
}