Backend API, and authorization
{
"id": 1,
"item": "Item name",
"description": "Details or description of to-do list item",
"due_date": "2019-05-20"
}
- id is auto-generated by 'todo' table.
- user_id is generated by our CRUD functions
- item is a string limited to 128 characters
- description is of type 'text'
- due_date is of type 'date'
- Required: username and password fields.
- Required: username and password fields.
-
GET request to this route will return list of all todos per user.
-
POST request to this route will add a new to-do item to logged-in user's list.
-
Required field: 'item'.
-
Recommended fields: 'description', 'priority', 'due_date'.
-
GET request to this route (with 'id' replaced by todo ID) will return the todo list item with the specified ID only if associated with logged-in user.
-
PUT request to this route (with valid todo ID) will update to-do item, and return number of updated items for logged-in user.
-
Required field: 'item'.
-
Recommended fields: 'description', 'priority', 'due_date'.
-
DELETE request to this route (with valid todo ID) will delete to-do item from list, and return the number of items deleted for the logged-in user.