> ## Documentation Index
> Fetch the complete documentation index at: https://docs.velt.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Comments

Use this API to retrieve comments in a specific CommentAnnotation.
Additional filters can be applied using comment IDs.

<Warning>
  Prior to using this API, you must:

  * Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
  * Deploy v4 series of the Velt SDK.
</Warning>

# Endpoint

`POST https://api.velt.dev/v1/commentannotations/comments/get`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="organizationId" type="string" required>
      Organization ID
    </ParamField>

    <ParamField body="documentId" type="string" required>
      Document ID
    </ParamField>

    <ParamField body="annotationId" type="string" required>
      Comment Annotation ID
    </ParamField>

    <ParamField body="userIds" type="string[]" required>
      User IDs
    </ParamField>

    <ParamField body="commentIds" type="number[]">
      Array of Comment IDs
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### 1. Get all comments with a CommentAnnotation by organizationId, documentId, and annotationId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "annotationId": "yourAnnotationId"
  }
}
```

#### 2. Get specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "annotationId": "yourAnnotationId",
    "commentIds": [
      153783,
      607395
    ]
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Comments(s) retrieved successfully.",
    "data": [
      {
        "commentHtml": "<div>Hello Updated 2</div>",
        "commentId": 153783,
        "commentText": "Sample Comment Text",
        "from": {
          "email": "user@example.com",
          "name": "User Name",
          "userId": "yourUserId"
        },
        "lastUpdated": "2024-06-20T09:53:42.258Z",
        "status": "added",
        "type": "text"
      },
      null // If comment not found
    ]
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Comments(s) retrieved successfully.",
      "data": [
        {
          "commentHtml": "<div>Hello Updated 2</div>",
          "commentId": 153783,
          "commentText": "Sample Comment Text",
          "from": {
            "email": "user@example.com",
            "name": "User Name",
            "userId": "yourUserId"
          },
          "lastUpdated": "2024-06-20T09:53:42.258Z",
          "status": "added",
          "type": "text"
        }
      ]
    }
  }
  ```
</ResponseExample>
