Playlist dataset

Get a playlist dataset

playlists - Return a dataset of Playlist objects for a selected site id. Pagination object will be included as an additional sub-object to the response.

Description

mixed playlists ( int $id , bool $encode );
This method is type of GET and will not receive any POST parameters.

Result will return an object containing two arrays:

Playlists (Array) - Playlists dataset for a selected site (paginated).
Pagination (Array) - Pagination data info.

Parameters

@param (int) $id - Site id (required)
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $site_id = 1080;
    print_r($api->playlists($site_id));
?>

Note the pagination part of the response, it can help you to walk through the entire data response. Example:

{"page":1,"current":3,"count":3,"prevPage":1,"nextPage":1,"pageCount":1,"order":"Playlist.id DESC","limit":10,"options":[],"paramType":"named","left":1,"right":1}

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $site_id = 1080;
    print_r($api->playlists($site_id, true));
?>