This to-do list API provides the following functionalities:
- Adding a new task.
- Marking an exiting task as completed.
- Deleting an existing task.
- Retrieving all tasks, completed and uncompleted.
- Retrieving completed tasks.
- Retrieving uncompleted tasks.
To build and run a docker image:
docker-compose up
-
Adding a new task:
Request:curl -X POST -H "Content-Type: application/json" -d '{ "description": "<New Task>" }' http://localhost:5000/add-new-task
Respose:
204
-
Marking an exiting task as completed:
Request:curl -X POST -H "Content-Type: application/json" -d '{ "description": "<Task Name>" }' http://localhost:5000/mark-task-as-completed
Respose:
204
-
Deleting an existing task:
Request:curl -X DELETE -H "Content-Type: application/json" -d '{ "description": "<Task Name>" }' http://localhost:5000/delete-task
Respose:
204
-
Retrieving all tasks:
Request:curl http://localhost:5000/all-tasks
Respose:(sample response)
[ { "created_at": "2018-03-23T01:50:16.016712", "description": "Task#1", "type": "COMPLETED" }, { "created_at": "2018-03-23T01:50:16.016717", "description": "Task#2", "type": "UNCOMPLETED" }, ... ]
-
Retrieving completed tasks:
Request:curl http://localhost:5000/completed-tasks
Respose:(sample response)
[ { "created_at": "2018-03-23T01:50:16.016712", "description": "Task#1", "type": "COMPLETED" }, ... ]
-
Retrieving uncompleted tasks:
Request:curl http://localhost:5000/uncompleted-tasks
Respose:(sample response)
[ { "created_at": "2018-03-23T01:50:16.016717", "description": "Task#2", "type": "UNCOMPLETED" }, ... ]