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
Properties | Description | Type |
---|---|---|
eventId | The id of the event | String |
Channels | Array of objects containing channels | Object |
Properties | Description | Type |
---|---|---|
_id | The id of the channel | String |
enabled | whether enabled or disabled | Boolean |
archivedForUsers | Array of users for whom the channel is archived | Array |
customer | id of the customer | String |
chatRoom | chat room id | String |
channelName | Name of the channel | String |
notifyAllUsers | setting for notifying all users when a message or activity happens in the channel | Boolean |
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
}
]
}