Skip to main content
Version: Version 2.0

Create comment

This endpoint enables you to create a comment within a specific thread in a room. Comments are the individual messages or responses within a thread, allowing users to discuss and collaborate on specific points or areas.

The first comment in a thread is considered the main comment. It typically sets the context or initial topic for the thread. Subsequent comments in the same thread are replies or follow-ups to this main comment, forming a conversation or discussion around the specific point or area marked by the thread.

How to use

You can use the following cURL to obtain a response on the endpoint:

curl --location --request POST https://api.superviz.com/threads/{threadId}/comments \
--header 'Content-Type: application/json' \
--header "client_id: ${YOUR CLIENT_ID}" \
--header "secret: ${YOUR SECRET}" \
--data '{
"text": "This is a comment",
"participantId": "PARTICIPANT_ID"
}'

Headers

When using this endpoint, you need to provide the Client ID and Secret Key. The following headers are required:

NameDescription
client_idRequired. You need to use the Client ID to authenticate in this repository. You can retrieve your Client ID under the Dashboard > Developer > Keys.
secretRequired. You need to use the Secret Key to authenticate in this repository. You can create a new API Secret under our Dashboard > Developer > Keys.

Request Body

NameTypeDescription
threadIdstringThe ID of the thread.
textstringThe text of the comment.
participantIdstringThe ID of the participant.

Response

Status code 201 will indicate that the comment was created successfully.

NameTypeDescription
uuidstringThe UUID of the comment.
participantIdstringThe ID of the participant.
threadIdstringThe ID of the thread.
textstringThe text of the comment.
participantobjectThe participant who created the comment.
mentionsarrayThe mentions in the comment.
createdAtstringThe date and time of the comment.

The participant object contains:

NameTypeDescription
namestringThe name of the participant.
createdAtstringThe date and time when the participant was created.
avatarstringThe URL of the participant's avatar image.
emailstringThe email address of the participant.

The mentions array contains:

NameTypeDescription
participantIdstringThe ID of the participant who was mentioned.
namestringThe name of the participant who was mentioned.

Example:

{
"uuid": "08fb673d-3b82-4847-9367-4bae347b352f",
"participantId": "eaa7d950-6c1f-4e9f-aa0e-20d8fa9fc876",
"threadId": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"text": "This is a sample comment text.",
"participant": {
"name": "John Doe",
"createdAt": "2023-09-12T15:30:45.123Z",
"avatar": "https://example.com/avatars/johndoe.jpg",
"email": "johndoe@example.com"
},
"mentions": [
{
"participantId": "qwerty123-4567-8901-2345-678901234567",
"name": "Jane Smith"
}
],
"createdAt": "2023-09-12T21:53:54.838Z"
}