API Documentation
X-API-KEY : API-KEY
Required Header
This header is required for using all the API's. KEY based Authentication is used in this project. API-KEY is stored in setting.py
{
"status": "error",
"message": "API key missing or invalid"
}
this response will be returned when using invalid API-KEY or it is missing
/api/tasks/
Fetch All Data
This API is used to retrieve all tasks stored in the database. Request method GET is used to retervie the json data
{
"status": "success",
"data": [
{
"id": 1,
"title": "Task One",
"description": "Demo task",
"due_date": "2025-12-28",
"status": "PENDING"
},
{
"id": 2,
"title": "Task Two",
"description": "Another task",
"due_date": "2025-12-29",
"status": "COMPLETED"
}
]
}
/api/tasks/<task-id>
Retervie Single Data
This API is used to retrieve detail of a single task using its unique ID. Parameter ID is passed to reterive the data. Request method GET is used to retervie the json data
{
"status": "success",
"data": [
{
"id": 1,
"title": "Task One",
"description": "Demo task",
"due_date": "2025-12-28",
"status": "PENDING"
}
]
}
/api/tasks/update/<task-id>
Retervie Single Data
This API is used to update a single task using its unique ID. The task ID is passed as a URL parameter, and the update operation is performed using the PUT HTTP method.
Example of Request Body which consist the fields of Task. Which can be Updated
{
"title": "Updated task title",
"description": "Updated description",
"due_date": "2025-12-30",
"status": "COMPLETED"
}
After making PUT request this response will be returned
{
"status": "success",
"data": {
"id": 13,
"title": "This is updated",
"description": "this is demo task and updated",
"due_date": "2025-12-28",
"status": "PENDING"
}
}
/api/tasks/delete/<task-id>
Permanently Remove Specific Data
This API endpoint is responsible for deleting a single task record
from the database using its unique identifier (ID).
It allows the client to permanently remove a task that is no longer required.
DELETE method is used to complete this action
{
"status": "success",
"message": "Task deleted successfully"
}