Skip to main content

getActiveChannels();

When Channels/Sub-Rooms are enabled in the chat, you can use this method to fetch the list of currently active channels/sub-rooms.

JavaScript

const channels = await sdk.getActiveChannels();

Response Properties

PropertiesDescriptionType
eventIdThe id of the eventString
ChannelsArray of objects containing channelsObject
PropertiesDescriptionType
_idThe id of the channelString
enabledwhether enabled or disabledBoolean
archivedForUsersArray of users for whom the channel is archivedArray
customerid of the customerString
chatRoomchat room idString
channelNameName of the channelString
notifyAllUserssetting for notifying all users when a message or activity happens in the channelBoolean

Sample Response

This returns a Array of Objects containing the Active Channels.

JSON Sample response getActiveChannels
{
"eventId": "53e16b7a-ff52-4c76-bf5f-d292c8db97eb",
"channels": [
{
"_id": "6325e6bef0357f1c648791a4",
"enabled": true,
"archivedForUsers": [],
"customer": "631794a83671700c713b1ce5",
"chatRoom": "631794a83671700c713b1ce6",
"channelName": "test channel",
"notifyAllUsers": false,
"created": "2022-09-17T15:24:46.468Z",
"__v": 0
},
{
"_id": "6325e6cdf0357f1c648791a5",
"enabled": true,
"archivedForUsers": [],
"customer": "631794a83671700c713b1ce5",
"chatRoom": "631794a83671700c713b1ce6",
"channelName": "lobby channel",
"notifyAllUsers": false,
"created": "2022-09-17T15:25:01.769Z",
"__v": 0
}
]
}