Skip to content

UI builder - Studio API

Channel

To execute Channel APIs, take a look at the examples below:

Api.profile("My Profile").channel("My Channel").setChannelName("New Channel Name");
Api.profile("My Profile").channel("My Channel").setAsProgram();
Api.profile.program.setChannelName("New Channel Name");

There is no Api.channel. A channel is always reached through a profile: Api.profile(...).channel(name), or the two shortcuts Api.profile.program and Api.profile.preview, which target the active profile's program and preview channels without naming them.

A channel target also supports every function of the Profile API - Api.profile('P').channel('C').takeIn('1001') works.

Every function on this page is asynchronous and returns a Promise.

Properties

Property Type Description
name string The name of the channel (read-only)
type string The type of the channel (read-only)

updateChannel

Sets the new type and/or new name of the Channel

Api.profile("My Profile").channel("My Channel").updateChannel(type: string, name?: string): Promise<any>;
Parameter Type Description
type string The Type of channel to be changed to: PROGRAM, PREVIEW or NONE
name string The name of the Channel to be updated. Optional.

Passing only one of the two leaves the other unchanged: setChannelType calls updateChannel(type) and setChannelName calls updateChannel(undefined, name).

setChannelType

Sets the new type of Channel

Api.profile("My Profile").channel("My Channel").setChannelType(type: string): Promise<any>;
Parameter Type Description
type string The Type of channel to be changed to: PROGRAM, PREVIEW or NONE

setChannelName

Sets the new name of the Channel

Api.profile("My Profile").channel("My Channel").setChannelName(name: string): Promise<any>;
Parameter Type Description
name string The new name of the Channel

setAsProgram

Set the Channel as Program - shorthand for updateChannel('PROGRAM')

Api.profile("My Profile").channel("My Channel").setAsProgram(): Promise<any>;

setAsPreview

Set the Channel as Preview - shorthand for updateChannel('PREVIEW')

Api.profile("My Profile").channel("My Channel").setAsPreview(): Promise<any>;

setAsRegularChannel

Set the Channel as Regular Channel - shorthand for updateChannel('NONE')

Api.profile("My Profile").channel("My Channel").setAsRegularChannel(): Promise<any>;