Skip to main content

Get participants on a channel

This endpoint enables you to get a list of all participants that are currently connected to a specific channel in a room.

How to use

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

curl --request GET \
--url https://api.superviz.com/realtime/participants/CHANNEL_NAME \
--header "client_id: ${YOUR CLIENT_ID}" \
--header "secret: ${YOUR SECRET}"

HTTP Request

GET /realtime/participants/{channel_name}

In the request, you will need to send in the path following field:

NameDescription
channelRequired. The name of the channel.

Headers

When using this endpoint, you need to provide the API 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.

Response

Status code 200 will indicate that the request was successful. The response will be a list in a JSON format, and include the following fields:

NameTypeDescription
participantsarrayThe list of currently connected participants. This value can be nullable, meaning that the event wasn't dispatched by a participant.
participants[].idstringThe ID of the participant.
participants[].namestringThe name of the participant.
participants[].connectionIdstringThe current connection ID of the participant. This value can be nullable, meaning that the event wasn't dispatched by a participant.
participants[].timestampnumberThe timestamp when the participant connected to the room.
participants[].channelstringThe ID of the room the participant is connected to.

Example:

[
{
"id": "b38ygi",
"name": "PARTICIPANT_NAME",
"connectionId": "CONNECTION_ID",
"timestamp": 1716815551683,
"channel": "CHANNEL_NAME",
}
]