Edit playlist

Edit playlist

editPlaylist - Edit existing playlist in Brid platform.

Description

mixed editPlaylist ( array $_post , bool $encode );
This method is type of POST.

Parameters

@param (array) $_post - Array of post data (required)
@param (int) id - Playlist id @param (string) name - Video title (max 250 chars)
@param (string) ids - CSV of video ids (required)
@param (int) partner_id - Site id (required)
@param (string) publish - Publish date (format required d-m-Y)
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'id'=>'1',
            'name'=>'Playlist Title' ,
            'partner_id'=>1 ,
            'ids'=>'1,2,3,videoId...' ,
            'publish'=>'25-12-2013',

     );

    print_r($api->editPlaylist($post));
?>

Result

{"success":true,"status":"success","message":"Playlist has been saved.","redirect":"\/playlists\/index\/","id":"136","Videos":{"success":true,"status":true,"message":"Video(s) added successfully.","redirect":"\/playlists\/index\/","id":"136","playlist_videos":{"1":"774","2":"775","3":"776"}}}

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'id'=>'1',
            'name'=>'Playlist Title' ,
            'partner_id'=>1 ,
            'ids'=>'1,2,3,videoId...' ,
            'publish'=>'25-12-2013',

     );

    print_r($api->editPlaylist($post,true));
?>

Result

stdClass Object ( [success] => 1 [status] => success [message] => Playlist has been saved. [redirect] => /playlists/index/ [id] => 135 [Videos] => stdClass Object ( [success] => 1 [status] => 1 [message] => Video(s) added successfully. [redirect] => /playlists/index/ [id] => 135 [playlist_videos] => stdClass Object ( [1] => 770 [2] => 771 [3] => 772 ) ) )