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://nodeapi.superviz.com/realtime/participants/{room}/{channel} \
--header 'apiKey: {{apiKey}}'
HTTP Request
GET /realtime/participants/{room}/{channel}
In the request, you will need to send in the path following field:
Name | Description |
---|---|
room | Required. The ID of the room. |
channel | Required. The name of the channel. |
Headers
When using this endpoint, you need to provide the API Key. The following headers are required:
Name | Description |
---|---|
apikey | Required. You must utilize the SuperViz Token that can be found on the developer page. By utilizing this key, we will define whether to get data from the developer or the production environment. |
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:
Name | Type | Description |
---|---|---|
participants | array | The list of currently connected participants. This value can be nullable, meaning that the event wasn't dispatched by a participant. |
participants[].id | string | The ID of the participant. |
participants[].name | string | The name of the participant. |
participants[].connectionId | string | The current connection ID of the participant. This value can be nullable, meaning that the event wasn't dispatched by a participant. |
participants[].timestamp | number | The timestamp when the participant connected to the room. |
participants[].roomId | string | The ID of the room the participant is connected to. |
Example:
[
{
"id": "b38ygi",
"name": "<PARTICIPANT_NAME>",
"connectionId": "<CONNECTION_ID>",
"timestamp": 1716815551683,
"roomId": "random",
}
]