Skip to content

totask Comment API Documentation

Comment Routes

All comment-related endpoints are prefixed with /comment.

Create Comment

Endpoint: POST /comment/:cardId/create

Description: Creates a new comment for a specific card.

Request Body:

json
{
  "text": "Comment text",
  "boardId": "board_id"
}

Response:

  • 200 OK
    json
    {
      "_id": "comment_id",
      "text": "Comment text",
      "user": {
        "_id": "user_id",
        "name": "User Name"
      }
    }

Get Comment by ID

Endpoint: GET /comment/:commentId

Description: Retrieves a comment by its ID.

Response:

  • 200 OK
    json
    {
      "_id": "comment_id",
      "text": "Comment text",
      "user": {
        "_id": "user_id",
        "name": "User Name"
      }
    }

Update Comment by ID

Endpoint: PUT /comment/:commentId

Description: Updates a comment by its ID.

Request Body:

json
{
  "text": "Updated comment text"
}

Response:

  • 200 OK
    json
    {
      "_id": "comment_id",
      "text": "Updated comment text",
      "user": {
        "_id": "user_id",
        "name": "User Name"
      }
    }

Delete Comment by ID

Endpoint: DELETE /comment/:commentId

Description: Deletes a comment by its ID.

Response:

  • 200 OK
    json
    {
      "_id": "comment_id",
      "text": "Deleted comment text",
      "user": {
        "_id": "user_id",
        "name": "User Name"
      }
    }