Record Comment
While data is stored inside records, communication in Tape usually happens inside comments on those records. Comments can be created, retrieved, updated and deleted via the API.
Create a record comment
To create a new record comment for the record with the specified record_id
, issue a POST request to this endpoint. The POST body has to contain the value
property with the text of the comment. It may further specify file_ids
, an array of temporary file IDs analog to the attachment field type. More details on file uploads can be found here.
Apart from plain text, the comment value
property supports limited formatting and extra options:
- Forcing newlines using
\n
- Adding a user mention using the proper syntax, e.g. for this user with ID 123 and name "Dan Jacob":
@[Dan Jacob](user:123)
The following query paramters are available:
Query param | Type | Description |
---|---|---|
silent | boolean | Do not generate notifications for this operation (default: false ) |
hook | boolean | Execute webhooks for this operation (default: true ) |
The following example creates a plain text comment on the record with ID 1:
- cURL
- JSON
curl -X POST https://api.tapeapp.com/v1/comment/record/1 \
-u user_key_replace_with_your_api_key: \
-H "Content-Type: application/json" \
--data '{
"value": "This is a comment on record with ID 1."
}'
{
"value": "This is a comment on record with ID 1."
}
{
"comment_id": 1000,
"value": "This is a comment on record with ID 1.",
"created_on": "2022-03-01 12:00:00",
"ref": { "type": "record", "id": 1 },
"created_by": {
"user_id": 600,
"mail": ["[email protected]"],
"image": null,
"name": "Dan Jacob",
"org_id": 1,
"type": "user"
}
}
Retrieve a comment
Retrieve the comment with the specified comment_id
:
curl https://api.tapeapp.com/v1/comment/1000 \
-u user_key_replace_with_your_api_key:
{
"comment_id": 1000,
"value": "This is a comment on record with ID 1.",
"created_on": "2022-03-01 12:00:00",
"ref": { "type": "record", "id": 1 },
"created_by": {
"user_id": 600,
"mail": ["[email protected]"],
"image": null,
"name": "Dan Jacob",
"org_id": 1,
"type": "user"
}
}
Delete a comment
Delete the comment with the specified comment_id
.
The following query paramters are available:
Query param | Type | Description |
---|---|---|
silent | boolean | Do not generate notifications for this operation (default: false ) |
hook | boolean | Execute webhooks for this operation (default: true ) |
curl -X DELETE https://api.tapeapp.com/v1/comment/1 \
-u user_key_replace_with_your_api_key:
{}
Retrieve comments for a record
Retrieve comments for the record with the specified record_id
. Note that results are paginated.
curl https://api.tapeapp.com/v1/comment/record/1?limit=2 \
-u user_key_replace_with_your_api_key:
{
"total": 2,
"cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJibGFiRGVmSWQiOjgsInZhbHVlcyI6WzE1OV0sImV4cCI6MTY1MDYxODc3OH0.iY5TnLSBDGCnFXbStcrLPTmP6MATnS_JKywbvC4tx3g",
"comments": [
{
"comment_id": 1000,
"value": "This is a comment on record with ID 1.",
"created_on": "2022-03-01 12:00:00",
"ref": { "type": "record", "id": 1 },
"created_by": {
"user_id": 600,
"mail": ["[email protected]"],
"image": null,
"name": "Dan Jacob",
"org_id": 1,
"type": "user"
}
},
{
"comment_id": 1001,
"value": "This is another comment on record with ID 1.",
"created_on": "2022-03-01 13:00:00",
"ref": { "type": "record", "id": 1 },
"created_by": {
"user_id": 600,
"mail": ["[email protected]"],
"image": null,
"name": "Dan Jacob",
"org_id": 1,
"type": "user"
}
}
]
}
Query Parameters
Parameter | Type | Type | Min | Max |
---|---|---|---|---|
limit | integer | Number of comments to return. Defaults to 100. | 0 | 100 |
cursor | string | Cursor for pagination | - | - |