This API allows you to update an existing task in a specified list.
PUT /api/v1/tasks
JSON payload:
{ "task_id": "61948", "update_task_name": "Update Website Content", "update_note": "Ensure all pages are updated with the new branding", "update_due_date": "2024-03-11", "set_mark_as_important": true, "IsDoingToday": true }
Bearer <Access-Token>
(This assumes token-based authentication. Modify as per your actual authentication/authorization method.)The API will respond with a JSON object containing the following fields:
{
"status": "success",
"message": "Task successfully updated.",
"data": {
"task_id": "61948",
"list_id": "7998",
"task_name": "Update Website Content",
"list_name": "Marketing Tasks",
"note": "Ensure all pages are updated with the new branding",
"due_date": "2024-03-11",
"mark_as_important": true,
"assigned_to": null,
"verify_by": null,
"IsDoingToday": true
}
}
HTTP Status Code: 404 Not Found
‘List Id’ provided in the request body doesn’t exist
{
"status": "error",
"message": "Not Found",
"errors": {
"list_id": "The specified List ID does not exist"
}
}
Task Id provided in the request body doesn’t exist
{
"status": "error",
"message": "Not Found",
"errors": {
"task_id": "The specified Task ID does not exist"
}
}
400 Bad Request
Request body not provided
{
"status": "error",
"message": "Bad Request",
"errors": {
"task_id": "Task ID is required",
"list_id": "List ID is required",
"task_name": "Task Name is required"
}
}
List Id is not provided in the request body
{
"status": "error",
"message": "Bad Request",
"errors": {
"list_id": "List ID is required"
}
}
Task Id is not provided in the request body
{
"status": "error",
"message": "Bad Request",
"errors": {
"task_id": "Task ID is required"
}
}
Task Id not matching with URL Task Id
{
"status": "error",
"message": "Bad Request",
"errors": {
"task_id": "URL task_id and Model task_id is not same."
}
}
401 Unauthorized
Invalid token
{
"status": "error",
"message": "Unauthorized",
"errors": {
"authorization": "Token is invalid or expired"
}
}