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://api.superviz.com/realtime/CHANNEL_NAME \
--header "client_id: ${YOUR CLIENT_ID}" \
--header "secret: ${YOUR SECRET}"
HTTP Request
GET /realtime/{channel}
In the request, you will need to send in the path following field:
Name | Description |
---|---|
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 |
---|---|
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. |
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 |
---|---|---|
channel | object | The channel object. |
channel.name | string | The ID of the channel provided when creating it. |
channel.participantId | string | The ID of the participant that created the channel. |
channel.apiKey | string | Your API key. |
channel.startTime | number | The timestamp when the channel was created. |
channel.endTime | number | The timestamp when the channel was closed. If the value is null then the channel 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[].channel | string | The ID of the room the participant is connected to. |
Example:
{
"channel": {
"id": "9c8261a1-ad82-4270-b560-1594aba2164b",
"name": "new-channel",
"participantId": "charlotte-robinson",
"apiKey": "API_KEY",
"startTime": 1728496793408,
"endTime": null
},
"presences": [
{
"id": "charlotte-robinson",
"name": "Charlotte Robinson",
"connectionId": "CYhm5l5vLl4GbderACAn",
"timestamp": 1728496793419,
"channel": "new-channel"
}
],
"events": [
{
"name": "message:new-channel",
"participantId": "elijah-baker",
"data": {
"name": "test",
"payload": {
"message": "Hello, world!"
}
},
"timestamp": 1728479838663,
"connectionId": "k6EKl_G0xRP0J227ABwd"
},
{
"name": "message:new-channel",
"participantId": "elijah-baker",
"data": {
"name": "test",
"payload": {
"message": "Hello, world!"
}
},
"timestamp": 1728479841202,
"connectionId": "k6EKl_G0xRP0J227ABwd"
}
]
}