Add a comment to a To-Do

POST /api/sync/v1/todos/comments

Operation id: addCommentV2

Description

This API adds comments to a specific to-do. The users who are recipients of that to-do or have task-view-all permission can add comments. This API allows to add a standalone comment or reply to a parent comment. It does not allow to add a reply to a child comment of the main comment.

The record Id is the to-do id here. ParentId is optional and it should be entered only when a reply to that parent comments needs to be added.

The mention parameter allows to tag any user/role to the comment. This an optional parameter which can be ignored.

The API allows to pass on the metadata of the attached files to the comment as file. The actual attachment of files happen through FILE UPLOAD API.

Tags: Comment APIs

Security

  • Bearer (http / bearer)
    • enter the client service token value.

Responses

200 — adding comments

Content type: application/json

400 — Bad Request

401 — Unauthorised Access

500 — Internal Server Error

Request body

Required: Yes

application/json

Schema

PropertyTypeRequiredDescription
recordIdinteger (int32)Yesrecord Id
commentstringNo
parentIdinteger (int32)Noparent Id
mentionsarrayNo
attachmentsarrayNo
{
  "type": "object",
  "required": [
    "recordId"
  ],
  "properties": {
    "recordId": {
      "type": "integer",
      "format": "int32",
      "description": "record Id",
      "example": 1
    },
    "comment": {
      "type": "string",
      "example": "Comment added to task"
    },
    "parentId": {
      "type": "integer",
      "format": "int32",
      "description": "parent Id",
      "example": 1
    },
    "mentions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "recipientType"
        ],
        "properties": {
          "recipientId": {
            "type": "integer",
            "format": "int64"
          },
          "recipientType": {
            "type": "string",
            "enum": [
              "USER",
              "ROLE",
              "DEPARTMENT",
              "EVERYONE"
            ]
          }
        }
      }
    },
    "attachments": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "attachments assigned to entities (V3/V4 format with fileHash)",
        "properties": {
          "fileHash": {
            "type": "string",
            "description": "hash of the file (obtained from file upload API)",
            "example": "abc123def456"
          }
        }
      }
    }
  }
}

Response models

200 — adding comments

Content type: application/json

Schema

PropertyTypeRequiredDescription
messagestringNo
statusstringNo
statusCodeinteger (int32)No
debugErrorMessagestringNo
messageCodestringNomessage codes
messageParamsarrayNo
commentIdinteger (int32)No
dataobjectNo
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "SUCCESS",
        "FAIL",
        "BAD_REQUEST",
        "NO_CONTENT",
        "UNAUTHORIZED",
        "FORBIDDEN",
        "NOT_FOUND",
        "INTERNAL_SERVER_ERROR",
        "UNSUPPORTED_MEDIA_TYPE",
        "UNPROCESSABLE_ENTITY"
      ]
    },
    "statusCode": {
      "type": "integer",
      "format": "int32"
    },
    "debugErrorMessage": {
      "type": "string"
    },
    "messageCode": {
      "type": "string",
      "description": "message codes",
      "items": {
        "type": "string",
        "example": [
          "ERROR23-Error while saving comment.",
          "ERROR403_08-You do not have permission to perform this action."
        ]
      }
    },
    "messageParams": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "commentId": {
      "type": "integer",
      "format": "int32"
    },
    "data": {
      "type": "object"
    }
  }
}