SysGetChannelInfo
tip
This method is available in Cloud Code scripts only.
Returns description info and activity stats for the specified channel. Note that numMembers, numListeners and listeners are only returned for non-global groups.
| Service | Operation |
|---|---|
| chat | SYS_GET_CHANNEL_INFO |
Method Parameters
| Parameter | Description |
|---|---|
| channelId | The id of the channel |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var channelId = "55555:gl:bcDev";
var chatProxy = bridge.getChatServiceProxy();
var postResult = chatProxy.sysGetChannelInfo(channelId);
if (postResult.status == 200) {
// Success!
}
{
"service": "chat",
"operation": "SYS_GET_CHANNEL_INFO",
"data": {
"channelId": "55555:gl:bcDev"
}
}
JSON Response
{
"status": 200,
"data": {
"id": "55555:gl:brainCloudDev",
"type": "gl",
"code": "brainCloudDev",
"name": "brainCloud dev",
"desc": "For discussing brainCloud development status",
"stats": {
"messageCount": 25
}
}
}
Common Error Code
Status Codes
| Code | Name | Description |
|---|---|---|
| 40346 | CHAT_INVALID_CHANNEL_ID | The channel id provided is invalid. |
| 40601 | RTT_NOT_ENABLED | RTT must be enabled for this feature |
| 40616 | CLOUD_CODE_ONLY | Method only available via cloud code |