- Get todos
- HTTP Method :
GET
- Endpoint :
/api/todos
- Response
- Status Code :
200
- Body
[ { "id": 1, "name": "Todo name", "description": "Todo description", "isFinsihed": false, "dueDate": "YYYY-MM-DD HH:mm" }, ... ]
- Status Code :
- HTTP Method :
- Create todo
- HTTP Method :
POST
- Endpoint :
/api/todos
- Request
{ "name": "Todo name", "description": "Todo description", "dueDate": "YYYY-MM-DD HH:mm" // optional }
- Response
- Status Code :
201
- Body
{ "id": 1, "name": "Todo name", "description": "Todo description", "isFinished": false, "dueDate": "YYYY-MM-DD HH:mm" }
- Status Code :
- HTTP Method :
- Get todo by id
- HTTP Method :
GET
- Endpoint :
/api/todos/:id
- Response
- Status Code :
200
- Body
{ "id": 1, "name": "Todo name", "description": "Todo description", "isFinished": false, "dueDate": "YYYY-MM-DD HH:mm" }
- Status Code :
- HTTP Method :
- Update todo by id
- HTTP Method :
PUT
- Endpoint :
/api/todos/:id
- Request
{ "name": "Todo name", "description": "Todo description", "isFinished": false, "dueDate": "YYYY-MM-DD HH:mm" }
- Response
- Status Code :
200
- Body
{ "message": "Todo with id=:id successfully updated" }
- Status Code :
- HTTP Method :
- Delete todo by id
- HTTP Method :
DELETE
- Endpoint :
/api/todos/:id
- Response
- Status Code :
200
- Body
{ "message": "Todo with id=:id successfully deleted" }
- Status Code :
- HTTP Method :
- Change status todo
- HTTP Method :
PATCH
- Endpoint :
/api/todos/finish/:id
&&/api/todos/unfinish/:id
- Response
- Status Code :
200
- Body
{ "message": "Todo with id=:id is finished" // finished / unfinished }
- Status Code :
- HTTP Method :
- Use pagination for get all todos
- Create Login, Register for User Schema
- Use Authentication before access all
/api/todos
- Use Authorization to grant access specify todo for related user (E.g. User A cannot access Todo with id=2 because User A just create todo with ids 1 & 3)