Skip to main content
Skip table of contents

Comments

Contents

Comment lifecycle

Comments can be created for Projects, Files, Contacts and Tasks. They cannot be edited or deleted. For more information see Comments document model.

List Comments

List all comments.

Endpoint:

URL

/api/v2/comments/

Method

GET

Expected response code

200

Expected response type

JSON

Example:

BASH
curl -v \
    -H "Authorization: apikey $API_USER:$API_KEY" \
    $COREDATA_BASE_URL/api/v2/comments/

Example response:

Comment list JSON
JSON
{
    "meta": {
        "limit": 20,
        "next": null,
        "offset": 0,
        "previous": null,
        "total_count": 2
    },
    "objects": [
        {
            "author": "/api/v2/users/Administrator/",
            "doc_id": "ad2e105c-77c8-11ee-aeee-13451b1d7d84",
            "id": "10be9294-77ed-11ee-8d2c-ffa226e3fdbf",
            "resource_uri": "/api/v2/comments/10be9294-77ed-11ee-8d2c-ffa226e3fdbf/",
            "text": "First comment.",
            "time": "2023-10-31T12:57:36.685000+00:00"
        },
        {
            "author": "/api/v2/users/Administrator/",
            "doc_id": "ad2e105c-77c8-11ee-aeee-13451b1d7d84",
            "id": "1412e210-77ed-11ee-8cae-1f9f05a73453",
            "resource_uri": "/api/v2/comments/1412e210-77ed-11ee-8cae-1f9f05a73453/",
            "text": "Second comment.",
            "time": "2023-10-31T12:57:42.274000+00:00"
        }
    ]
}

Get Comment details

Get details for a comment.

Endpoint:

URL

/api/v2/comments/$comment_id/

Method

GET

Expected response code

200

Expected response type

JSON

URL parameters:

  • comment_id – ID of an existing comment to get details for.

Example:

BASH
comment_id=10be9294-77ed-11ee-8d2c-ffa226e3fdbf

curl -v \
    -H "Authorization: apikey $API_USER:$API_KEY" \
    $COREDATA_BASE_URL/api/v2/comments/$comment_id/

Example response:

Comment details JSON
JSON
{
    "author": "/api/v2/users/Administrator/",
    "doc_id": "ad2e105c-77c8-11ee-aeee-13451b1d7d84",
    "id": "10be9294-77ed-11ee-8d2c-ffa226e3fdbf",
    "resource_uri": "/api/v2/comments/10be9294-77ed-11ee-8d2c-ffa226e3fdbf/",
    "text": "First comment.",
    "time": "2023-10-31T12:57:36.685000+00:00"
}

Create Comment

Create a Comment to an existing Document (Projects, Files, Contacts and Tasks).

Endpoint:

URL

/api/v2/comments/

Method

POST

Content-Type

application/json

Expected response code

201

Expected response type

JSON

Request JSON object has the following fields:

Field

Type

Description

Mandatory

doc_id

String

ID (in UUID format) of a document to add comment for. The parameter can refer one of the following document types: Projects, Files, Contacts and Tasks.

Yes

text

String

Text of the comment to add.

Yes

Example:

BASH
project_id=ad2e105c-77c8-11ee-aeee-13451b1d7d84
text="Third comment"

curl -v \
    -X POST \
    -H "Authorization: apikey $API_USER:$API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"doc_id\": \"$project_id\", \"text\": \"$text\"}" \
    $COREDATA_BASE_URL/api/v2/comments/

The response has Location header which contains URL of the newly added comment:

CODE
Location: /api/v2/comments/0eb1eca2-77fd-11ee-ace4-8ffda3b6069a/
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.