Get channel info
This endpoint enables you to get information about a specific channel, including the last 250 events and participants connected to it.
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/channel-info/{room}/{channel} \
--header 'apiKey: {API_KEY}' \
HTTP Request
GET /realtime/channel-info/{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 in JSON format, and include the following fields:
Name | Type | Description |
---|---|---|
room | object | The room object. |
room.name | string | The ID of the room provided when creating it. |
room.participantId | string | The ID of the participant that created the room. |
room.apiKey | string | Your API key. |
room.startTime | number | The timestamp when the room was created. |
room.endTime | number | The timestamp when the room was closed. If the value is null then the room is still open. |
events | array | The list of the last 250 events. |
events[].name | string | The name of the event. |
events[].timestamp | number | The timestamp when the event was published. |
events[].participantId | string | The ID of the participant that published the event. |
events[].connectionId | string | The connection ID of the connection used to publish the message. This value can be nullable, meaning that the event wasn't dispatched by a participant. |
events[].data | object | The data of the event. |
participants | array | The list of currently connected participants. |
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. |
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:
{
"room": {
"id": "d2eb3150-85ca-4d73-878b-58ebc32e605d",
"name": "random",
"participantId": "b38ygi",
"apiKey": "7uju3ynxy0bmhwu2xj5a1uxqyn9rvk",
"startTime": 1716815551515,
"endTime": null
},
"events": [
{
"name": "draw",
"timestamp": 1714161910778,
"participantId": "<PARTICIPANT_NAME>",
"connectionId": "<CONNECTION_ID>",
"data": {
...
}
}
],
"participants": [
{
"id": "b38ygi",
"name": "<PARTICIPANT_NAME>",
"connectionId": "<CONNECTION_ID>",
"timestamp": 1716815551683,
"roomId": "random",
}
]
}