Channel Management

Beebotte channel management provides the following operations:

  • Create Channel to create new channels programmatically. This is useful when channels need to be created in real-time.
  • Get Channel to get the list of already created channels.
  • Delete Channel to delete existing channels programmatically.

Channel Management operations require authentication using the account API and Secret Keys.


Create Channel

You can create a new channel as follows:

bclient.addChannel({
    name: 'channel1',
    label: 'Channel 1',
    description: 'channel 1 description',
    ispublic: true, //public or private channel
    resources: [
        {name: 'res1', description: 'res1 description', vtype: 'number'},
        {name: 'res2', vtype: 'string'} //description is optional
    ]
}, function(err, res) {
    if(err) console.log(err);
    // On success res is set to true
    console.log(res);
});
## This operation is not available yet!
// This operation is not available yet!
Channel channel = new Channel();
channel.Name = "channel1";
channel.Label = "label1";
channel.Description = "description1";
channel.IsPublic = false;
var resources = new List
    {
        new Resource("res1", "res1 label", "res1 description", "number"),
        new Resource("res2", "res2 label", "res2 description", "string")
    };
channel.Resources = resources;
bclient.CreateChannel(channel);

Get Channel

You can get the description of a created channel as follows:

bclient.getChannel('channel1', function(err, res) {
    if(err) console.log(err);
    // On success, res is the JSON description of the channel
    console.log(res);
});
channel = bclient.getChannel('channel1')
// This operation is not available yet!
var channel = bclient.GetChannel("channel1");

You can get the list of all created channels in one call as follows:

bclient.getChannel('*', function(err, channels) {
    if(err) console.log(err);
    // On success, res is an Array of JSON description of the channels
    console.log(res);
});
channel = bclient.getChannel()
// This operation is not available yet!
var channels = bclient.GetAllChannels();

Delete Channel

You can delete an existing channel as follows:

bclient.deleteChannel('channel1', function(err, res) {
    if(err) console.log(err);
    // On success, res is set to true
});
bclient.deleteChannel('channel1')
// This operation is not available yet!
bclient.DeleteChannel("channel1");