This API allows you to add a comment to a specific task in a specified list.
POST /api/v1/tasks/comments
JSON payload:
{ "task_id": "60965", "Comment": "This task requires additional clarification." }
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 was found and comment was added.", "data": { "task_id": "60965", "task_name": "Good evening", "comment": "This task requires additional clarification." } }
403 Forbidden
User does not have permission to the list and add a comment on the task
{
"status": "error",
"message": "User does not have permission",
"errors": {
"authorization": "User does not have the rights to update this task"
}
}
404 Not Found
Task ID does not exist
{
"status": "error",
"message": "Bad Request",
"errors": {
"task_id": "The specified Task ID does not exist"
}
}
List ID does not exist
{
"status": "error",
"message": "Bad Request",
"errors": {
"list_id": "The specified List ID does not exist"
}
}
400 Bad Request
Comment not provided in the request body
{
"status": "error",
"message": "Bad Request",
"errors": {
"comment": "Comment is required"
}
}
Request body not provided
{
"status": "error",
"message": "Bad Request",
"errors": {
"list_id": "List ID is required",
"task_id": "Task ID is required",
"comment": "Comment is required"
}
}
401 Unauthorized
Invalid Token
{ "status": "error", "message": "Unauthorized", "errors": { "authorization": "Token is invalid or expired" } }