Skip to main content

Mentions

When working with Contextual Comments, a participant can mention others by using the @ symbol followed by the participant's name.

Enabling mentions

All participants that are initialized only from the SuperViz Room will be seen as a guest, therefore, other participants won't be able to mention them. The guest participant will be able to mention other participants.

Before you can mention a participant, you will need to ensure that the participant is a member of the group, by creating and adding them to the group. The group can be your entire organization, small teams, or any other group of participants.

Creating a group

You can create a group by utilizing the create or update a group API endpoint, by sending a PUT request to the /groups/{group_id} endpoint. On the path you can provide a group ID of your choice and in the body, you can provide the name of the group. Like so:

curl --location --request PUT https://api.superviz.com/groups/{id} \
--header "client_id: ${YOUR CLIENT_ID}" \
--header "secret: ${YOUR SECRET}" \
--header "Content-Type: application/json" \
--data-raw '{
"name": "My Group"
}'

When starting a room with the same group ID as the one you created, the participants of that group will be able to mention each other.

Creating a participant

Before adding a participant to a group, you will need to create the participant with our API, by utilizing the create or update a participant API endpoint. The endpoint is a POST request to /participants, and in the body, you can provide the participant ID, name, and email. Like so:

curl --location --request POST /participants \
--header "client_id: ${YOUR CLIENT_ID}" \
--header "secret: ${YOUR SECRET}" \
--header "Content-Type: application/json" \
--data-raw '{
"participantId": "123",
"id": "123",
"name": "John Doe",
"email": "john@superviz.com",
"avatar": "https://www.superviz.com/avatar.png"
}'

Adding a participant to a group

You can add a participant to a group by utilizing the add a participant to a group API endpoint, by sending a POST request to the /groups/participant/{participantId} endpoint. On the path you can provide a participant ID of your choice and in the body the group ID. Like so:

curl --location --request POST https://api.superviz.com/groups/participant/{participantId} \
--header "client_id: ${YOUR CLIENT_ID}" \
--header "secret: ${YOUR SECRET}" \
--header "Content-Type: application/json" \
--data-raw '{
"group_id": "group_id"
}'
Adding several participants in a batch

If needed to work with several participants at once, you can create multiple participants with only one request, and then add them to a group or more with one request.

Receiving a notification

To create a great user experience, you will need to send a notification to the mentioned participant, allowing them to easily navigate to the comment and respond. You will receive a webhook event when a participant is mentioned in a comment. The CREATE_MENTION event will provide detailed information about the comment of the participant who was mentioned and the context.

For a better understanding of how you can utilize webhooks on your application, follow our webhook guidelines.