Table Of Contents
ToDoList REST Endpoints
Title: add a todo item
Endpoint: POST /todos
URL Params: task: the todo's description (string)
done: whether or not it has been completed (boolean)
created: date when it was created (string).
Status Codes: 200 (OK) is always returned.
400 is returned if the params are bad.
Response Body: { }
Example:
Query: POST /todos?task=lecture&done=false&created=Oct%2013,%202018
Response: (status 200) { }
Title: get list of todos
Endpoint: GET /todos
URL Params:
Status Codes: 200 (OK) is always returned.
Response Body: {
todos: [ <todo-1>, <todo-2>, ...]
}
Example:
Query: GET /todos
Response: (status 200) {
[
{
"task: "Feed Wally",
"done": false,
"created": "June 10, 2018 at 5:30am",
"id": 5
},
{ ... },
...
]
}
Title: delete a todo item with given id
Endpoint: DELETE /todos
URL Params: id: the desired todo's id number
Status Codes: 200 (OK) is returned if todo exists.
400 is returned if the id is bad.
Response Body: { }
Example:
Query: DELETE /todos?id=5
Response: (status 200) { }
Title: modify an existing todo item
Endpoint: PUT /todos
URL Params: task: the todo's description (string)
done: whether or not it has been completed (boolean)
created: date when it was created (string).
Status Codes: 200 (OK) is returned if successful.
400 is returned if the params are bad, ie the item does not exist.
Response Body: { }
Example:
Query: PUT /todos?task=lecture&done=true&created=Oct%2013,%202018
Response: (status 200) { }