Fancy To Do is an application to manage your activity. This app has :
- RESTful endpoint for todo's CRUD operation
- JSON formatted response
Create new user
Request Header
not needed
Request Body
{
"name": "Adiet Alimudin",
"email": "test123@gmail.com",
"password": "1234567"
}
Response (201 - Created)
{
"id": 6,
"name": "Adiet Alimudin",
"email": "test123@gmail.com",
"password": "$2b$10$xfLIEC1yVj5TYtQ3PZw/c.0D97Ij5NOPC4BMOBdA9JSbPC3MAhvue",
"updatedAt": "2020-09-06T15:41:15.278Z",
"createdAt": "2020-09-06T15:41:15.278Z"
}
Response (400 - Bad Request)
[
"please enter correct email"
]
Response (409 - conflict)
{
"message": "Email Already registered!"
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}
Process Login
Request Header
not needed
Request Body
{
"email": "test123@gmail.com",
"password": "1234567"
}
Response (200 - Ok)
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjYsIm5hbWUiOiJNYWxpayIsImVtYWlsIjoibWFsaWtAbWFpbC5jb20iLCJpYXQiOjE1ODYxOTEzNjksImV4cCI6MTU4NjE5NDk2OX0.WNLicaqoVUNPgvqq_5y4bzXy9oflshME6ARWHk1z1Po"
}
Response (400 - Bad Request)
[
"message": "Wrong Password!"
]
Response (404 - Not Found)
{
"message": "user not registered!"
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}
Create new todo
Request Header
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjYsIm5hbWUiOiJNYWxpayIsImVtYWlsIjoibWFsaWtAbWFpbC5jb20iLCJpYXQiOjE1ODYxOTEzNjksImV4cCI6MTU4NjE5NDk2OX0.WNLicaqoVUNPgvqq_5y4bzXy9oflshME6ARWHk1z1Po"
}
Request Body
{
"title": "belajar nodejs"
"description": "belajar nodejs"
"status": "incomplete"
"due_date": "2020-10-01"
}
Response (201 - Created)
{
"id": 13,
"title": "belajar nodejs",
"description": "belajar nodejs",
"status": "Incomplete",
"due_date": "2020-10-01T00:00:00.000Z",
"UserId": 6,
"updatedAt": "2020-09-06T16:53:36.080Z",
"createdAt": "2020-09-06T16:53:36.080Z"
}
Response (400 - Bad Request)
[
"description can't be empty"
]
Response (401 - Unauthorized)
{
"message": "Not authenticated!"
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}
Get User's todos
Request Header
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjYsIm5hbWUiOiJNYWxpayIsImVtYWlsIjoibWFsaWtAbWFpbC5jb20iLCJpYXQiOjE1ODYxOTEzNjksImV4cCI6MTU4NjE5NDk2OX0.WNLicaqoVUNPgvqq_5y4bzXy9oflshME6ARWHk1z1Po"
}
Request Body
not needed
Response (200 - Ok)
[
{
"id": 14,
"title": "belajar nodejs",
"description": "belajar nodejs Ampe mahir",
"status": "Complete",
"due_date": "2020-10-01T00:00:00.000Z",
"UserId": 6,
"createdAt": "2020-09-06T17:00:37.435Z",
"updatedAt": "2020-09-06T17:04:42.252Z"
},
{
"id": 13,
"title": "belajar nodejs",
"description": "belajar nodejs Ampe mahir",
"status": "Complete",
"due_date": "2020-10-01T00:00:00.000Z",
"UserId": 6,
"createdAt": "2020-09-06T16:53:36.080Z",
"updatedAt": "2020-09-06T17:05:51.056Z"
}
]
Response (401 - Unauthorized)
{
"message": "Not authenticated!"
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}
Get todo by todo's id
Request Header
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjYsIm5hbWUiOiJNYWxpayIsImVtYWlsIjoibWFsaWtAbWFpbC5jb20iLCJpYXQiOjE1ODYxOTEzNjksImV4cCI6MTU4NjE5NDk2OX0.WNLicaqoVUNPgvqq_5y4bzXy9oflshME6ARWHk1z1Po"
}
Request Body
not needed
Response (200 - Ok)
{
"id": 13,
"title": "belajar nodejs",
"description": "belajar nodejs Ampe mahir",
"status": "Complete",
"due_date": "2020-10-01T00:00:00.000Z",
"UserId": 6,
"createdAt": "2020-09-06T17:00:37.435Z",
"updatedAt": "2020-09-06T17:04:42.252Z"
}
Response (401 - Unauthorized)
{
"message": "Not authenticated!"
}
Response (403 - Forbidden)
{
"message": "Forbidden access!"
}
Response (404 - Not Found)
{
"message": "Todo not found! "
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}
Update todo
Request Header
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjYsIm5hbWUiOiJNYWxpayIsImVtYWlsIjoibWFsaWtAbWFpbC5jb20iLCJpYXQiOjE1ODYxOTEzNjksImV4cCI6MTU4NjE5NDk2OX0.WNLicaqoVUNPgvqq_5y4bzXy9oflshME6ARWHk1z1Po"
}
Request Body
{
"title": "belajar nodejs"
"description": "belajar nodejs Ampe mahir"
"status": "Complete"
"due_date": "2020-10-01"
}
Response (201 - Created)
{
"id": 13,
"title": "belajar nodejs",
"description": "belajar nodejs Ampe mahir",
"status": "Complete",
"due_date": "2020-10-01T00:00:00.000Z",
"UserId": 6,
"createdAt": "2020-09-06T17:00:37.435Z",
"updatedAt": "2020-09-06T17:04:42.252Z"
}
Response (401 - Unauthorized)
{
"message": "Not authenticated!"
}
Response (403 - Forbidden)
{
"message": "Forbidden access!"
}
Response (404 - Not Found)
{
"message": "Todo not found! "
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}
Update todo
Request Header
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjYsIm5hbWUiOiJNYWxpayIsImVtYWlsIjoibWFsaWtAbWFpbC5jb20iLCJpYXQiOjE1ODYxOTEzNjksImV4cCI6MTU4NjE5NDk2OX0.WNLicaqoVUNPgvqq_5y4bzXy9oflshME6ARWHk1z1Po"
}
Request Body
not needed
Response (200 - Ok)
{
"id": 15,
"title": "belajar nodejs",
"description": "belajar nodejs Ampe mahir",
"status": "Complete",
"due_date": "2020-10-01T00:00:00.000Z",
"UserId": 6,
"createdAt": "2020-09-06T17:04:12.393Z",
"updatedAt": "2020-09-06T17:04:12.393Z"
}
Response (401 - Unauthorized)
{
"message": "Not authenticated!"
}
Response (403 - Forbidden)
{
"message": "Forbidden access!"
}
Response (404 - Not Found)
{
"message": "Todo not found! "
}
Response (500 - Internal Server Error)
{
"message": "Internal Server Error"
}