POST
/
v2
/
commentannotations
/
get

Use this API to retrieve comment annotations from a document within an organization. Additional filters can be applied using location IDs, annotation IDs, or user IDs.

Endpoint

POST https://api.velt.dev/v2/commentannotations/get

Headers

x-velt-api-key
string
required

Your API key.

x-velt-auth-token
string
required

Body Example

Params

data
object
required

Example Requests

1. Get annotations by organizationId and documentId

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "pageSize": 10,
    "pageToken": "1720441573192",
    "statusId": "OPEN"
  }
}

2. Get annotations by organizationId, documentId, and locationIds

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationIds": [
      "locationx"
    ],
    "pageSize": 10,
    "pageToken": "1720441573192",
    "statusId": "OPEN"
  }
}

3. Get annotations by organizationId, documentId, locationIds, and userIds

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationIds": [
      "locationx"
    ],
    "userIds": [
      "yourUserId"
    ],
    "pageSize": 10,
    "pageToken": "1720441573192",
    "statusId": "OPEN"
  }
}

4. Get annotations by organizationId, documentId, and userIds

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "userIds": [
      "yourUserId"
    ],
    "pageSize": 10,
    "pageToken": "1720441573192",
    "statusId": "OPEN"
  }
}

5. Get annotations by organizationId, documentId, and annotationIds

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "annotationIds": [
      "yourAnnotationId1",
      "yourAnnotationId2"
    ],
    "pageSize": 10,
    "pageToken": "1720441573192",
    "statusId": "OPEN"
  }
}

6. Get annotations by organizationId, documentId, locationIds, and annotationIds

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationIds": [
      "locationx"
    ],
    "annotationIds": [
      "yourAnnotationId1",
      "yourAnnotationId2"
    ],
    "pageSize": 10,
    "pageToken": "1720441573192",
    "statusId": "OPEN"
  }
}

Response

Success Response

{
  "result": {
    "status": "success",
    "message": "Annotations fetched successfully.",
    "data": [
      {
        "annotationId": "yourAnnotationId",
        "comments": [
          {
            "commentId": 123456,
            "commentText": "This is a sample comment text.",
            "commentHtml": "<p>This is a sample comment text.</p>",
            "from": {
              "userId": "user123",
              "name": "John Doe",
              "email": "john.doe@example.com"
            },
            "lastUpdated": "2023-06-15T10:30:00Z"
          }
        ],
        "from": {
          "userId": "user123",
          "name": "John Doe",
          "email": "john.doe@example.com"
        },
        "color": "#00FF00",
        "createdAt": "2023-06-15T10:30:00Z",
        "lastUpdated": "2023-06-15T10:30:00Z",
        "status": {
          "id": "OPEN",
          "name": "Open",
          "color": "#0000FF",
          "type": "default"
        }
      },
      null // null is returned only if you provided an annotationId that doesn't exist
    ],
    "nextPageToken": "pageToken"
  }
}

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}