Skip to content

Alsheh/To-Do_List_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To-Do List API

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.

Docker

To build and run a docker image:

docker-compose up

Interaction with the API (locally)

  1. 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

  2. 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

  3. Deleting an existing task:
    Request:

    curl -X DELETE -H "Content-Type: application/json" -d '{
        "description": "<Task Name>"
    }' http://localhost:5000/delete-task
    

    Respose:
    204

  4. 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"
      }, 
      ...
    ]
    
  5. 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"
      }, 
      ...
    ]
    
  6. 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"
      }, 
      ...
    ]
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published