Update video or playlist status

Update video or playlist status

changeStatus - Change a videos or playlists status flag.

Description

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

Parameters

@param (array) $_post - Array of post data (required)
@param (string) controller - Controller value ['videos' or 'playlists'] (required)
@param (int) id - Content id depending of the controller value (Video.id or Playlist.id) (required)
@param (int) partner_id - Site id (required)
@param (string) status - Status (flag) value [0 or 1], 0 = paused, 1=active (required)
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
           'id'=>2,
           'partner_id'=>1080,
           'controller'=>'videos',
           'status'=>0

    );

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

Result

{"success":true,"status":"success","message":"The Video has been saved."}

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
           'id'=>137,
           'partner_id'=>1080,
           'controller'=>'playlists',
           'status'=>0

    );

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

Result

stdClass Object ( [success] => 1 [status] => success [message] => The Playlist has been saved. )