Get a Realtime channel
GET
/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}
const channel = await bird.realtime.channels.get("rap_01krdgeqcxet5s7t44vh8rt9mg", "presence-lobby", {
include: ["member_count"],
});
console.log(channel.occupied, channel.member_count);channel = client.realtime.channels.get(
"rap_01krdgeqcxet5s7t44vh8rt9mg", "presence-lobby", include=["member_count"]
)
print(channel.occupied, channel.member_count)channel, err := client.Realtime.Channels.Get(context.Background(), "rap_123", "presence-lobby", bird.RealtimeChannelGetParams{
Include: []bird.RealtimeChannelInclude{bird.RealtimeIncludeMemberCount},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(channel.Occupied, channel.MemberCount)$channel = $bird->realtime->channels->get($appId, 'room-42');
echo $channel->getMemberCount(), ' members';curl -X GET "https://us1.platform.bird.com/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}" \
-H "Authorization: Bearer $TOKEN"Returns a single channel's occupancy and optional counts. A channel appears when its first connection subscribes and disappears when its last connection leaves. An unknown or unused name returns 200 OK with occupied: false.
Parameter
realtime_app_id
string
ID of the Realtime app (rap_ prefix), as returned when the app was created.
channel_name
string
Name of the Realtime channel to retrieve.
Parameter Kueri
include
array
Attributes to include. Repeatable. Requesting member_count for a non-presence channel, or connection_count when the app's connection-counting flag is off, returns a validation error (400).
Payload Respons
member_count
integer
Distinct members (presence channels only; requires include=member_count).
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.
occupied
boolean
wajib
Whether at least one client is subscribed.
Sumber daya terkait
Lanjutkan dengan dokumentasi, panduan, dan contoh untuk topik ini. Sumber daya tersedia dalam bahasa Inggris.
Jelajahi kemampuannyaRealtimeIkuti jalur pembelajaranBuild your first integrationPanduan implementasiSend your first realtime event
Coba praktiknya dan dapatkan ringkasan implementasi