PUT & POST

Add a video into Brid

addVideo - Add a new video into the Brid platform.

Description

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

Parameters

@param (array) $_post - Array of post data (required)
@param (string) name - Video title (max 250 chars)
@param (string) description - Video description
@param (string) publish - Publish date (format required d-m-Y)
@param (string) image - Snapshot image Url
@param (int) channel_id - Channel id (required)
@param (int) partner_id - Site id (required)
@param (int) image_width - Snapshot image width
@param (int) image_height - Snapshot image height
@param (string) mp4 - Video Url source (required)
@param (string) mp4_hd - Video Url source HD
@param (int) mp4_hd_on - Try to play Video Url source HD (0,1)
@param (int) file_size - Video source filesize
@param (date) publish - Publish date format (d-m-Y)
@param (string) landing_page - Landing page Url
@param (int) age_gate_id - Age gate setting (0,1,2)
@param (int) tags - CSV tags
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'name'=>'My Video Title' , 
            'description'=>'My Video Description text' , 
            'channel_id'=>1 ,
            'partner_id'=>1 ,
            'tags'=>'my,video,tags' ,
            'image'=>'http://www.your-site.com/path_to_video_image.jbg' , 
            'mp4'=> 'http://www.your-site.com/path_to_video.mp4' , 
            'publish'=>'25-12-2013'

    );

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

Result

{"success":true,"status":"success","message":"The Video has been saved.","startEncoding":false,"videoId":"3383","externalId":"","encoding":"","thumb":[],"redirect":"\/videos\/index\/"}

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'name'=>'My Video Title' , 
            'description'=>'My Video Description text' , 
            'channel_id'=>1 ,
            'partner_id'=>1 ,
            'tags'=>'my,video,tags' ,
            'image'=>'http://www.your-site.com/path_to_video_image.jbg' , 
            'mp4'=> 'http://www.your-site.com/path_to_video.mp4' , 
            'publish'=>'25-12-2013'

    );

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

Result

stdClass Object ( [success] => 1 [status] => success [message] => The Video has been saved. [startEncoding] => [videoId] => 3384 [externalId] => [encoding] => [thumb] => Array ( ) [redirect] => /videos/index/ )

Add a playlist

addPlaylist - Add a new playlist into the Brid platform.

Description

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

Parameters

@param (array) $_post - Array of post data (required)
@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(
            'name'=>'Playlist Title' ,
            'partner_id'=>1 ,
            'ids'=>'1,2,3,videoId...' ,
            'publish'=>'25-12-2013',

     );

    print_r($api->addPlaylist($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(
            'name'=>'Playlist Title' ,
            'partner_id'=>1 ,
            'ids'=>'1,2,3,videoId...' ,
            'publish'=>'25-12-2013',

     );

    print_r($api->addPlaylist($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 ) ) )

Add videos to a playlist

addVideoPlaylist - Add new video(s) to an existing playlist in Brid.

Description

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

Parameters

@param (array) $_post - Array of post data (required)
@param (int) id - Playlist id (required)
@param (string) ids - CSV of video ids (required)
@param (int) partner_id - Site id (required)
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'partner_id'=>1 ,
            'ids'=>'1,2,3,videoId...' ,
            'id'=>130,

     );

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

Result

{"playlist_videos":{"3317":"777","3316":"778"},"status":true,"message":"Video(s) added successfully."}

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(

            'partner_id'=>1 ,
            'ids'=>'1,2,3,videoId...' ,
            'id'=>130,

     );

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

Result

stdClass Object ( [playlist_videos] => stdClass Object ( [3317] => 783 [3316] => 784 ) [status] => 1 [message] => Video(s) added successfully. )

Sort videos in playlist

sortVideos - Sort videos in a single playlist.

Description

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

Parameters

@param (array) $_post - Array of post data (required)
@param (string) sort - CSV of video ids (required)
@param (int) partner_id - Site id (required)
@param (int) id - Playlist id (required)
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(

            'partner_id'=>1 ,
            'sort'=>'1,2,3,videoId...' ,
            'id'=>137,

     );

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

Result

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

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(

            'partner_id'=>1 ,
            'sort'=>'1,2,3,videoId...' ,
            'id'=>137,

     );

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

Result

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

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. )