List Realtime channels
GET
/v1/realtime/apps/{realtime_app_id}/channels
const { data } = await bird.realtime.channels.list("rap_01krdgeqcxet5s7t44vh8rt9mg", {
prefix: "presence-",
include: ["member_count"],
});
for (const channel of data) console.log(channel.name, channel.member_count);channels = client.realtime.channels.list(
"rap_01krdgeqcxet5s7t44vh8rt9mg", prefix="presence-", include=["member_count"]
)
for channel in channels.data:
print(channel.name, channel.member_count)channels, err := client.Realtime.Channels.List(context.Background(), "rap_123", bird.RealtimeChannelListParams{
Prefix: "presence-",
Include: []bird.RealtimeChannelInclude{bird.RealtimeIncludeMemberCount},
})
if err != nil {
log.Fatal(err)
}
for _, ch := range channels.Data {
fmt.Println(ch.Name, ch.MemberCount)
}foreach ($bird->realtime->channels->list($appId, ['prefix' => 'room-'])->getData() ?? [] as $channel) {
echo $channel->getName(), ' ', $channel->getMemberCount(), "\n";
}curl -X GET "https://us1.platform.bird.com/v1/realtime/apps/{realtime_app_id}/channels" \
-H "Authorization: Bearer $TOKEN"Réponse200
{
"data": [
{
"name": "orders-42"
}
]
}
Lists the app's currently occupied channels, optionally filtered by name prefix.
Paramètres
realtime_app_id
string
ID of the Realtime app (rap_ prefix), as returned when the app was created.
Paramètres de requête
prefix
string
Only channels whose name starts with this prefix (for example, presence-).
include
array
Per-channel attributes to include. Repeatable. Requesting member_count without a presence-channel prefix, or connection_count when the app's connection-counting flag is off, returns a validation error (400).
Contenu de la réponse
data
array of object
obligatoire
The occupied channels, sorted by name.
Afficher les attributs enfants
data.member_count
integer
Distinct members (presence channels only; requires include=member_count).
data.connection_count
integer
Connections currently subscribed to this channel (requires include=connection_count and the app's connection-counting flag). Channel-scoped: distinct from the app-wide peak connections metric.
data.name
string
obligatoire
A Realtime channel name. Only letters, digits, and _ - = @ , . ; Prefix with private- or presence- for authenticated channels, or private-encrypted- for channels whose payloads are end-to-end encrypted with a key only you hold.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet. Les ressources sont en anglais.
Explorer la fonctionnalitéRealtimeSuivre le parcours d'apprentissageBuild your first integrationGuide d'implémentationSend your first realtime event
Essayez la pratique et obtenez un guide d'implémentation