Get channel details

Fetch details of a specific channel using the TryGetChannel() or GetChannelAsync methods.

Requires App Context

To store data about channels, you must enable App Context for your app's keyset in the Admin Portal.

Method signature

These methods take the following parameters:

chat.TryGetChannel(
string channelId,
out Channel channel
)

Input

* required
ParameterDescription
channelId *
Type: string
Default:
n/a
Unique channel identifier (up to 92 UTF-8 byte sequences).
channel *
Type: out Channel
Default:
n/a
The channel to populate with the appropriate Channel object if the method returns true. If it returns false, the channel remains uninitialized.

Output

If the method returns true, the out channel parameter is populated with the appropriate Channel object. If it returns false, the channel remains uninitialized.

Basic usage

Fetch the support channel metadata.

if (chat.TryGetChannel("support", out var channel))
{
Console.WriteLine($"Found channel with name {channel.Name}");
};
Last updated on
On this page