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:
| Name | Description |
|---|---|
client_id | Required. You need to use the Client ID to authenticate in this repository. You can retrieve your Client ID under the Dashboard > Developer > Keys. |
secret | Required. 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
| Name | Type | Description |
|---|---|---|
threadId | string | The ID of the thread. |
text | string | The text of the comment. |
participantId | string | The ID of the participant. |
Response
Status code 201 will indicate that the comment was created successfully.
| Name | Type | Description |
|---|---|---|
uuid | string | The UUID of the comment. |
participantId | string | The ID of the participant. |
threadId | string | The ID of the thread. |
text | string | The text of the comment. |
participant | object | The participant who created the comment. |
mentions | array | The mentions in the comment. |
createdAt | string | The date and time of the comment. |
The participant object contains:
| Name | Type | Description |
|---|---|---|
name | string | The name of the participant. |
createdAt | string | The date and time when the participant was created. |
avatar | string | The URL of the participant's avatar image. |
email | string | The email address of the participant. |
The mentions array contains:
| Name | Type | Description |
|---|---|---|
participantId | string | The ID of the participant who was mentioned. |
name | string | The 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"
}