GetChannelId
Retrieves a channel id given the specified lookup parameters.
| Service | Operation |
|---|---|
| chat | GET_CHANNEL_ID |
Method Parameters
| Parameter | Description |
|---|---|
| channelType | The channel type - ‘gl’ for global, ‘gr’ for groups, ‘dy’ for dynamic. |
| channelSubId | The type-specific sub id. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var channelType = "gl";
var channelSubId = "myChatRoom";
var chatProxy = bridge.getChatServiceProxy();
var postResult = chatProxy.getChannelId(channelType, channelSubId);
if (postResult.status == 200) {
// Success!
}
{
"service": "chat",
"operation": "GET_CHANNEL_ID",
"data": {
"channelType": "gl",
"channelSubId": "myChatRoom"
}
}
JSON Response
{
"status": 200,
"data": {
"channelId": "55555:gl:brainCloudDev"
}
}
Common Error Code
Status Codes
| Code | Name | Description |
|---|---|---|
| 40601 | RTT_NOT_ENABLED | RTT must be enabled for this feature |
| 40603 | CHAT_UNRECOGNIZED_CHANNEL | The sub id for the channel type is not recognized |