My fancy-todo App is an application to manage your fancy-todo. This app has :
- RESTful endpoint for todo's CRUD operation
- JSON formatted response
Create new todo
Request Header
{
"access_token": "<your access token>"
}
Request Body
{
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>"
}
Response (201 - Created)
{
"id": <given id by system>,
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z"
}
Response (400 - Bad Request)
{
"message": "Invalid requests"
}
Response (500 - Server Error)
{
"message": "Internal server error"
}
Get all fancy-todo
Request Header
{
"access_token": "<your access token>"
}
Request Body
not needed
Response (200)
[
{
"id": 1,
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
},
{
"id": 2,
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
}
]
Response (500 - Server Error)
{
"message": "Internal server error"
}
Get fancy-todo based id
Request Header
{
"access_token": "<your access token>"
}
Request Params
{
"id": "<id of todo>"
}
Request Body
not needed
Response (200)
{
"id": 1,
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
}
Response (500 - Server Error)
{
"message": "Internal server error"
}
Response (404 - Not Found)
{
"message": "Not Found"
}
Update todo
Request Header
{
"access_token": "<your access token>"
}
Request Params
{
"id": "<id of todo>"
}
Request Body
{
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>"
}
Response (200 - Updated)
{
"id": <given id by system>,
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z"
}
Response (400 - Bad Request)
{
"message": "Invalid requests"
}
Response (404 - Not Found)
{
"message": "Not Found"
}
Response (500 - Server Error)
{
"message": "Internal server error"
}
Get fancy-todo based id
Request Header
{
"access_token": "<your access token>"
}
Request Params
{
"id": "<id of todo>"
}
Request Body
not needed
Response (200)
{
"id": 1,
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
}
Response (404 - Not Found)
{
"message": "Not Found"
}
Response (500 - Server Error)
{
"message": "Internal server error"
}
Create new user
Request Body
{
"email": "<email to get insert into>",
"password": "<password to get insert into>",
}
Response (201 - Created)
{
"id": <given id by system>,
"email": "<email to get insert into>"
}
Response (400 - Bad Request)
{
"message": "Invalid requests"
}
Response (500 - Server Error)
{
"message": "Internal server error"
}
Login user
Request Body
{
"email": "<email to get insert into>",
"password": "<password to get insert into>",
}
Response (200 - OK)
{
"access_token": "<your access token>"
}
Response (400 - Bad Request)
{
"message": "Invalid requests"
}
Response (500 - Server Error)
{
"message": "Internal server error"
}
User bisa create todo dan findAll Todo jika memberikan accesstoken. acces token tersebut sudah terverivikasi(Authentication)
User hanya bisa melihat (findOne), menghapus dan menghapus todonya sendiri (Authorization)