Skip to content

UI builder - Studio API

Playlist

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

Api.playlist.readPage("My Page");
Api.playlist.readNext();
Api.playlist('My Playlist').readNext();

Api.playlist is also callable: passing a playlist name targets that playlist instead of the current one, in the same way Api.profile('My Profile') works.

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

readPage

Reads the Page provided in the Parameter

Api.playlist.readPage(page: string | number): Promise<any>;

Parameter Type Description
page string/number The Page ID of the Page to be read

readPrev

Reads the Previous Page

Api.playlist.readPrev(): Promise<any>;

readNext

Reads the Next Page

Api.playlist.readNext(): Promise<any>;

createPage

Creates a page in the playlist

Api.playlist.createPage(page: IPageCreateOptions, position?: IPageInsertPosition): Promise<any>;
Parameter Type Description
page IPageCreateOptions The page to create
position IPageInsertPosition Where to insert it; appended at the end when omitted

IPageCreateOptions is { template, num, name, description, channel, color }.
IPageInsertPosition is { before } or { after }.

See Classes for the full types.

createPages

Creates several pages in the playlist in one call

Api.playlist.createPages(pages: IPageCreateOptions[], position?: IPageInsertPosition): Promise<any>;
Parameter Type Description
pages IPageCreateOptions[] The pages to create
position IPageInsertPosition Where to insert them; appended at the end when omitted