Create Channel

ChannelRepository offers a function to create a new channel. This function provides support for creating three distinct types of channels, including Community, Live, and Conversation. Each channel type has its own unique characteristics and capabilities as we explained earlier, and the create channel function allows users to easily create and customize channels to suit their specific needs.

The SDK offers two standard ways for creating channels. The first method involves specifying a specific channel ID during the channel creation process. The second method allows for the automatic generation of a unique channel ID. The create channel API is designed to ensure that the channel being created is a new channel, and in the event that the requested channel already exists, it will return a conflict error (400900). The channel ID parameter in the channel creation function may be left undefined, in which case the SDK will automatically generate a unique channel ID to avoid any conflicts with existing IDs.

Create Community Channel

Here is a brief explanation of the function parameters:

  • displayName: The public display name of the channel.

  • avatarFileId: The image fileId that represents the image of the channel.

  • metaData: Additional properties to support custom fields.

  • tags - Arbitrary strings that can be used for defining and querying for the channels.

  • isPublic - Specify visibility for the community channel that public or private community.

Create Live Channel

Here is a brief explanation of the function parameters:

  • displayName: The public display name of the channel.

  • avatarFileId: The image fileId that represents the image of the channel.

  • metaData: Additional properties to support custom fields.

  • tags - Arbitrary strings that can be used for defining and querying for the channels.

Create Conversation Channel

Here is a brief explanation of the function parameters:

  • userId: The userId of the user that you'd like to chat with.

  • displayName: The public display name of the channel.

  • avatarFileId: The image fileId that represents the image of the channel.

  • metaData: Additional properties to support custom fields.

  • tags - Arbitrary strings that can be used for defining and querying for the channels.

Conversation channel is unique based on its membership. When creating conversation, the system will check if a channel with the same membership already exists. If such channel already exists, the system will return the existing channel instead of creating a new one.

Create Broadcast Channel

Last updated