fancy-todo
Fancy Todo App is an application to create reminder and get well organized. This app has :
- RESTful endpoint for asset's CRUD operation
- JSON formatted response
RESTful endpoints
POST /todos
Create new todos
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": 1,
"title": "<todo title>",
"description": "<todo description>",
"status": false,
"due_date": "<todo due date>"
"createdAt": "<todo created time>",
"updatedAt": "<todo updated time>",
}
Response (500 - Bad Request)
{
"message": "Internal server error"
}
GET /todos
Read all todos
Request Header
{
"access_token": "<your access token>"
}
Request Body
not needed
Response (200)
[
{
"id": 1,
"title": "<todo title>",
"description": "<todo description>",
"status": false,
"due_date": "<todo due date>"
"createdAt": "<todo created time>",
"updatedAt": "<todo updated time>",
},
{
"id": 2,
"title": "<todo title>",
"description": "<todo description>",
"status": false,
"due_date": "<todo due date>"
"createdAt": "<todo created time>",
"updatedAt": "<todo updated time>",
}
]
Response (400 - Bad Request)
{
"message": "Internal server error"
}
GET /todos/:id
Read todos by id
Request Header
{
"access_token": "<your access token>"
}
Request Body
not needed
Request Params
{
"id": "<todo id>"
}
Response (200)
{
"id": <id by params>,
"title": "<todo title>",
"description": "<todo description>",
"status": false,
"due_date": "<todo due date>"
"createdAt": "<todo created time>",
"updatedAt": "<todo updated time>",
}
Response (400 - Bad Request)
{
"message": "Data not found"
}
PUT /todos/:id
Update all todos's property by id
Request Header
{
"access_token": "<your access token>"
}
Request Body
{
"title": "<name to get insert into>",
"description": "<description to get insert into>",
"status": "<todo status>",
"due_date": "<todo due date>"
}
Request Params
{
"id": "<todo id>"
}
Response (200)
{
"id": <id by params>,
"title": "<todo title>",
"description": "<todo description>",
"status": "<todo status>",
"due_date": "<todo due date>"
"createdAt": "<todo created time>",
"updatedAt": "<todo updated time>",
}
Response (400 - Bad Request)
{
"message": "Internal server error"
}
Response (404 - Not found)
{
"message": "Error not found"
}
PATCH /todos/:id
Update todos's status property by id
Request Header
{
"access_token": "<your access token>"
}
Request Body
{
"status": "<todo status>"
}
Request Params
{
"id": "<todo id>"
}
Response (200)
{
"id": <id by params>,
"title": "<todo title>",
"description": "<todo description>",
"status": "<todo status>",
"due_date": "<todo due date>"
"createdAt": "<todo created time>",
"updatedAt": "<todo updated time>",
}
Response (400 - Bad Request)
{
"message": "Internal server error"
}
Response (404 - Not found)
{
"message": "Error not found"
}
DELETE /todos/:id
Delete todo by id
Request Header
{
"access_token": "<your access token>"
}
Request Body
not needed
Request Params
{
"id": "<todo id>"
}
Response (200)
{
"message": "todo success to delete"
}
Response (400 - Bad Request)
{
"message": "Internal server error"
}
Response (404 - Not found)
{
"message": "Error not found"
}
POST /googleoauth
POST login/register User
Request Header
{
id_token
}
Request Body
not needed
Request Params
not needed
Response (200)
{
"access_token": "<access token>"
}
Response (400 - Bad Request)
{
"message": "Internal server error"
}
Response (404 - Not found)
{
"message": "Error not found"
}