Skip to main content

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:

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 in JSON format, and include the following fields:

NameTypeDescription
channelobjectThe channel object.
channel.namestringThe ID of the channel provided when creating it.
channel.participantIdstringThe ID of the participant that created the channel.
channel.apiKeystringYour API key.
channel.startTimenumberThe timestamp when the channel was created.
channel.endTimenumberThe timestamp when the channel was closed. If the value is null then the channel is still open.
eventsarrayThe list of the last 250 events.
events[].namestringThe name of the event.
events[].timestampnumberThe timestamp when the event was published.
events[].participantIdstringThe ID of the participant that published the event.
events[].connectionIdstringThe 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[].dataobjectThe data of the event.
participantsarrayThe list of currently connected participants.
participants[].idstringThe ID of the participant.
participants[].namestringThe name of the participant.
participants[].connectionIdstringThe current connection ID of the participant.
participants[].timestampnumberThe timestamp when the participant connected to the room.
participants[].channelstringThe 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"
}
]
}