To-Do is an api that allows you to implement a to-do list feature in your frontend. It manages User, Tasks, and Tags giving CRUD operations to the models and also includes authentication for most endpoints.
Make HTTP requests to the endpoints given the correct information.
Important information: JWT authentication is accessed through the header named x-access-token. No BEARER required. All endpoints excluding /login and /register require JWT authentication in the header.
-
Creates / registers a user. Gives back user information and jwt token.
POST /api/user/register Protected : FALSE -
Logs in a user. Gives back user information and jwt token.
POST /api/user/login Protected : FALSE -
Gets all users in the database.
GET /api/user/ Protected : TRUE -
Gets a user by the user ID in the params. Returns specific user info.
GET /api/user/:user_id Protected : TRUE -
Updates a user by the user ID. Can update name and email. Returns updated user info.
PUT /api/user/:user_id Protected : TRUE -
Deletes the user by the given user ID from params. Returns deleted user info.
DELETE /api/user/:user_id Protected : TRUE
-
Creates a task and links it to the specified user by the user ID. Returns the creates task info.
POST /api/tasks/user/:user_id Protected : TRUE -
Gets the task by the given task ID. Returns task info.
GET /api/tasks/:task_id Protected : TRUE -
Updates the task given with the task ID. Returns the updated task info.
PUT /api/tasks/:task_id Protected : TRUE -
Deletes the task given with the task ID. Returns the deleted task info.
DELETE /api/tasks/:task_id Protected : TRUE -
Updates the task to be complete. Sets
PUT /api/tasks/:task_id/complete Protected : TRUEis_complete = TRUEand sets the completed date to the current. Returns the completed task info. -
Gets all tasks by user ID and and sorts all incomplete tasks. Returns all tasks where
GET /api/tasks/:user_id/incomplete Protected : TRUEis_completed = FALSE -
Gets all tasks linked to the user by the user ID. Returns all user tasks.
GET /api/tasks/user/:user_id Protected : TRUE -
Inserts a tag given by the tag ID and inserts it into the task given by the task ID. Returns the task with the updated tag inserted.
PUT /api/tasks/:task_id/tags/:tag_id Protected : TRUE -
Removes the tag given by the tag ID in the task given by the task ID. Returns the updated task with the removed tag.
PUT /api/tasks/:task_id/tags/:tag_id/remove Protected : TRUE -
Gets all tasks where the tag by the tag ID is included.
GET /api/tasks/user/:user_id/tags/:tag_id Protected : TRUE
-
Creates a tag and links it to the user that created it by the user ID. Returns the created tag info.
POST /api/tags/user/:user_id Protected : TRUE -
Gets the tag by the given tag ID. Returns the tag info.
GET /api/tags/:tag_id Protected : TRUE -
Updates the tag by the tag ID. Returns the updated tag info.
PUT /api/tags/:tag_id Protected : TRUE -
Deletes the tag by the tag ID. Returns the deleted tag info.
DELETE /api/tags/:tag_id Protected : TRUE -
Gets all tags by the user ID. Returns all tags created by the user.
GET /api/tags/user/:user_id Protected : TRUE