SysCreateChannel
Initializes a dynamic or system chat channel. Returns the channelId. Channel type can be "dy" or "sy".
Service | Operation |
---|---|
chat | SYS_CREATE_CHANNEL |
Method Parameters
Parameter | Description |
---|---|
channelType | The channel type - currently 'dy' and 'sy' are supported. |
channelSubId | An app-defined channel sub id. Only letters, numbers, dashes, and underscores are allowed. |
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 channelType = "dy";
var channelSubId = "myChatRoom";
var chatProxy = bridge.getChatServiceProxy();
var postResult = chatProxy.sysCreateChannel(channelType, channelSubId);
if (postResult.status == 200) {
// Success!
}
{
"service": "chat",
"operation": "SYS_CREATE_CHANNEL",
"data": {
"channelType": "dy",
"channelSubId": "myChatRoom"
}
}
JSON Response
{
"data": {
"channelId": "12345:dy:myChatRoom"
},
"status": 200
}