Retrieve all todos.
https://todo-training.herokuapp.com/todos
GET
(none)
https://todo-training.herokuapp.com/todos
json
{
"data": [
{
"id": 1,
"description": "todo",
"completed": false,
"dueDate": null
"updatedAt": "2019-08-13T11:53:05.551Z",
"createdAt": "2019-08-13T11:53:05.551Z"
},
{
"id": 2,
"description": "todo",
"completed": false,
"dueDate": null
"updatedAt": "2019-08-13T11:53:05.551Z",
"createdAt": "2019-08-13T11:53:05.551Z"
}
]
}
Retrieve one todo.
https://todo-training.herokuapp.com/todos/{id}
GET
Field | Type | Description |
---|---|---|
id | [int] | The id of todo to get |
https://todo-training.herokuapp.com/todos/1
json
{
"data": {
"id": 1,
"description": "todo",
"completed": false,
"dueDate": null
"updatedAt": "2019-08-13T11:53:05.551Z",
"createdAt": "2019-08-13T11:53:05.551Z"
}
}
Add todo to the todo list.
https://todo-training.herokuapp.com/todos
POST
Field | Type | Description |
---|---|---|
description | [string] | the description of todo |
Field | Type | Description |
---|---|---|
dueDate | [date] | the due date for todo |
endDate | [date] | the end date for todo |
https://todo-training.herokuapp.com/todos
json
{
"description": "todo"
}
json
{
"data": {
"id": 1,
"description": "todo",
"completed": false,
"dueDate": null,
"updatedAt": "2019-08-13T11:53:05.551Z",
"createdAt": "2019-08-13T11:53:05.551Z"
}
}
https://todo-training.herokuapp.com/todos/{id}
PUT
Field | Type | Description |
---|---|---|
id | [int] | The id of todo to update |
description | [string] | the description of todo |
completed | [bool] | state of todo |
Field | Type | Description |
---|---|---|
dueDate | [date] | the due date for todo |
endDate | [date] | the end date for todo |
https://todo-training.herokuapp.com/todos/1
json
{
"description": "todo",
"completed": true
}
json
{
"data": {
"id": 2,
"description": "todo",
"completed": true,
"dueDate": null,
"updatedAt": "2019-08-13T11:53:05.551Z",
"createdAt": "2019-08-13T11:53:05.551Z"
}
}
https://todo-training.herokuapp.com/todos/{id}
DELETE
Field | Type | Description |
---|---|---|
id | [int] | The id of todo to delete |
https://todo-training.herokuapp.com/todos/1
json
{
}