This document provides an overview of the API endpoints and their usage for our service,
that can be access on http://server.adaoho-project.my.id
- POST /user/register
- POST /user/login
- POST /user/google-login
- POST /user/github-login
- POST /user/facebook-login
- PATCH /user/:id
Endpoint to create account user with default role "staff"
{
"fullname": "string",
"email": "string",
"password": "string",
"imageUrl": "string",
"age": "integer",
"address": "string",
"phoneNumber": "string"
}
Click here for Response
Response (201 - Created)
{
"newUser": {
"id": 3,
"fullname": "Adnan Nugroho",
"email": "adnan@mail.com",
"imageUrl": "https://source.unsplash.com/random/500x500/?person",
"age": 25,
"address": "South Tangerang"
}
}
Response (400 - Bad Request)
{
"message": "Email is required"
}
OR
{
"message": "Invalid email format"
}
OR
{
"message": "Email must be unique"
}
OR
{
"message": "Full Name is required"
}
OR
{
"message": "Password is required"
}
{
"email": "string",
"password": "string"
}
Click here for Response
Response (200 - OK)
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhZG5hbkBtYWlsLmNvbSIsImZ1bGxOYW1lIjoiQWRuYW4gTnVncm9obyIsInBob3RvIjoiaHR0cHM6Ly9zb3VyY2UudW5zcGxhc2guY29tL3JhbmRvbS81MDB4NTAwLz9wZXJzb24iLCJpYXQiOjE3MDAxNTg2NTl9.1T4jd_rWB5yK-QaQAMz65QZhE8V7Htbbv8yYOkWgyyc",
"email": "adnan@mail.com",
"fullname": "Adnan Nugroho",
"photo": "https://source.unsplash.com/random/500x500/?person"
}
Response (400 - Bad Request)
{
"message": "Email Can't be Empty"
}
OR
{
"message": "Password Can't be Empty"
}
Response (401 - Unauthorized)
{
"message": "Invalid email/password"
}
{
"token": "string"
}
Click here for Response
Response (200 - OK)
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhZG5hbkBtYWlsLmNvbSIsImZ1bGxOYW1lIjoiQWRuYW4gTnVncm9obyIsInBob3RvIjoiaHR0cHM6Ly9zb3VyY2UudW5zcGxhc2guY29tL3JhbmRvbS81MDB4NTAwLz9wZXJzb24iLCJpYXQiOjE3MDAxNTg2NTl9.1T4jd_rWB5yK-QaQAMz65QZhE8V7Htbbv8yYOkWgyyc",
"fullname": "Adnan Nugroho",
"email": "adnan@mail.com",
"photo": "https://source.unsplash.com/random/500x500/?person"
}
Response (401 - Unauthorized)
{
"message": "Invalid email/password"
}
{
"fullname": "string",
"email": "string",
"password": "string",
"imageUrl": "string"
}
Click here for Response
Response (200 - OK)
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhZG5hbkBtYWlsLmNvbSIsImZ1bGxOYW1lIjoiQWRuYW4gTnVncm9obyIsInBob3RvIjoiaHR0cHM6Ly9zb3VyY2UudW5zcGxhc2guY29tL3JhbmRvbS81MDB4NTAwLz9wZXJzb24iLCJpYXQiOjE3MDAxNTg2NTl9.1T4jd_rWB5yK-QaQAMz65QZhE8V7Htbbv8yYOkWgyyc",
"fullname": "Adnan Nugroho",
"email": "adnan@mail.com",
"photo": "https://source.unsplash.com/random/500x500/?person"
}
{
"fullname": "string",
"email": "string",
"password": "string",
"imageUrl": "string"
}
Click here for Response
Response (200 - OK)
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhZG5hbkBtYWlsLmNvbSIsImZ1bGxOYW1lIjoiQWRuYW4gTnVncm9obyIsInBob3RvIjoiaHR0cHM6Ly9zb3VyY2UudW5zcGxhc2guY29tL3JhbmRvbS81MDB4NTAwLz9wZXJzb24iLCJpYXQiOjE3MDAxNTg2NTl9.1T4jd_rWB5yK-QaQAMz65QZhE8V7Htbbv8yYOkWgyyc",
"fullname": "Adnan Nugroho",
"email": "adnan@mail.com",
"photo": "https://source.unsplash.com/random/500x500/?person"
}
{
"name": "string",
"description": "string",
"price": "integer",
"imgUrl": "string",
"categoryId": "integer"
}
Authorization: Bearer <access_token>
Click here for Response
Response (201 - Created)
{
"getFruit": [
{
"id": 1,
"name": "Persimmon",
"family": "Ebenaceae",
"calories": "81",
"fat": "0",
"sugar": "18",
"carbohydrates": "18",
"protein": "0",
"imageUrl": "https://source.unsplash.com/random/900x700/?Persimmon",
"MovementId": 1
},
...
]
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"message": "Fetching data from FruityViceAPI Success"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"findCuisine": {
"id": 1,
"name": "Sloppy Joes",
"description": "This beats canned or ...",
"price": 12000,
"imgUrl": "https://img.sndimg.com/...",
"categoryId": 1,
"authorId": 1,
"createdAt": "2023-10-30T20:25:08.875Z",
"updatedAt": "2023-10-30T20:25:08.875Z"
}
}
Response (400 - Bad Request)
{
"message": "User didn't have any Data"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
{
"MovementId": "<integer>"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"message": "Add Movement <movement name> to User Success"
}
Response (400 - Bad Request)
{
"message": "Data Movement Already Being Input"
}
OR
{
"message": "Data Movement Already Being Deleted"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Response (404 - Not Found)
{
"message": "Error Data Not Found"
}
{
"imageUrl": "<file>"
}
{
"id": "integer (required)"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"message": "Image <entitiy_name> success to update"
}
Response (400 - Bad Request)
{
"message": "ImageURL can't be Empty"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Response (403 - Forbidden)
{
"message": "You're Not Authorized"
}
Response (404 - Not Found)
{
"message": "Error Data Not Found"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"message": "Sloppy White success to delete"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Response (403 - Forbidden)
{
"message": "You're Not Authorized"
}
Response (404 - Not Found)
{
"message": "Error Data Not Found"
}
{
"name": "string",
"quantity": "integer",
"price": "integer",
"total": "integer"
}
{
"id": "<integer>"
}
Authorization: Bearer <access_token>
Click here for Response
Response (201 - OK)
{
"addPurchase": {
"id": 6,
"name": "Indonesian",
"updatedAt": "2023-10-31T03:41:06.960Z",
"createdAt": "2023-10-31T03:41:06.960Z"
}
}
Response (400 - Bad Request)
{
"message": "Name can't be Empty"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
{
"id": "<integer>"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"updatedCategory": {
"id": 1,
"name": "Waffle Cone",
"createdAt": "2023-10-30T20:24:52.246Z",
"updatedAt": "2023-10-31T03:59:02.802Z"
}
}
Response (400 - Bad Request)
{
"message": "Name can't be Empty"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Response (403 - Forbidden)
{
"message": "You're Not Authorized"
}
Response (404 - Not Found)
{
"message": "Error Data Not Found"
}
{
"id": "<integer>"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"message": "Italian success to delete"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Response (403 - Forbidden)
{
"message": "You're Not Authorized"
}
Response (404 - Not Found)
{
"message": "Error Data Not Found"
}
{
"id": "<integer>"
}
Authorization: Bearer <access_token>
Click here for Response
Response (200 - OK)
{
"message": "Italian success to delete"
}
Response (401 - Unauthorized)
{
"message": "You're Not Authenticated"
}
Response (403 - Forbidden)
{
"message": "You're Not Authorized"
}
Response (404 - Not Found)
{
"message": "Error Data Not Found"
}
Response (401 - Unauthorized)
{
"message": "Invalid Token"
}
Response (500 - Internal Server Error)
{
"message": "Internal server error"
}