Skip to main content
Version: 5.7.0

GetChannelInfo

Returns description info and activity stats for the specified channel. Note that numMembers, numListeners and listeners are only returned for non-global groups. Only callable by members of the channel.

ServiceOperation
chatGET_CHANNEL_INFO

Method Parameters

ParameterDescription
channelIdThe id of the channel

Usage

http://localhost:3000


string channelId = "22817:gl:CHAT_TRADE"; // APP_ID:CHANNEL_TYPE:CHANNEL_ID
SuccessCallback successCallback = (response, cbObject) =>
{
Dictionary<string, object> jsonMessage = (Dictionary<string, object>)JsonFx.Json.JsonReader.Deserialize(response);
Dictionary<string, object> jsonData = (Dictionary<string, object>)jsonMessage["data"];
var name = jsonData["name"].ToString();
var desc = jsonData["desc"].ToString();

string logMessage = string.Join(" | ", new [] {name, desc});
Debug.Log(logMessage); // Trade Chat | Trade items here.
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("[GetChannelInfo Failed] {0} {1} {2}", status, code, error));
};
_bc.ChatService.GetChannelInfo(channelId, successCallback, failureCallback);
JSON Response
{
"data": {
"id": "22817:gl:CHAT_TRADE",
"type": "gl",
"code": "CHAT_TRADE",
"name": "Trade Chat",
"desc": "Trade items here.",
"stats": {
"messageCount": 25
}
},
"status": 200
}
Common Error Code

Status Codes

CodeNameDescription
40346CHAT_INVALID_CHANNEL_IDThe channel id provided is invalid.
40601RTT_NOT_ENABLEDRTT must be enabled for this feature