Function list

Here you can find the available functions within the RPC, which make it possible to execute API requests. More information concerning API requests can be found here: https://support.bluebillywig.com/vms-api-guide

3.1 doAction

Execute API request/action and return the result as an array.

array doAction(string $entity, string $action, array $arProps)

$entity: The relevant api entity that you want to query to obtain the desired result. For example mediaclip, mediacliplist, publication or playout.

$action: The action you want to execute. The actions differ per entity, see the API documentation for details. For example for the mediaclip entity possible actions are get, put or getUsageStats.

$arProps: This array will contain required or optional properties needed for the specific request. For example for the action put of the entity mediaclip you'll need to provide at least the property xml, see the example below.

Here an example to update a mediaclip:

include('bootstrap.php');
$usr = 'UserName';
$pwd = 'Password';
$pub = 'http://YourPublication.bbvms.com'; 

$vms=new VMSRpc($pub,$usr, $pwd);

//Set the status to draft
$arProps = array('xml' => '<media-clip id="1234567" status="draft"></media-clip>');
$r = $vms->doAction('mediaclip', 'put', $arProps);

And an example to add a new mediaclip including a video-file:

include('bootstrap.php');
$usr = 'UserName';
$pwd = 'Password';
$pub = 'http://YourPublication.bbvms.com'; 

$vms=new VMSRpc($pub,$usr, $pwd);

//Add a new mediaclip, add a file, set the title and set the status.
$file = getcwd()."/someVideo.mp4";
$arProps = array('xml' => '<media-clip title="New mediaclip"  status="draft"></media-clip>', 
                     'Filedata' => '@'.$file);

$r = $vms->doAction('mediaclip', 'put', $arProps);

3.2 JSON

Execute API request/action and return the result in JSON format. At this moment it's only possible to get results in JSON format for 'get' and 'search' actions on mediaclips, timelines, widgets and zones.

string json(string $entity, int $objectId=null, array $arProps=null)

$entity: The relevant api entity that you want to query to obtain the desired result. For example mediaclip, mediacliplist, publication or playout.

$objectId: (optional) The id of a certain entity, for example the mediaclipid. If $objectId is set the action will become 'get'.

$arProps: (optional) This array contains required or optional properties needed for the specific request.

Below an example to search for a couple of mediaclips.

$vms=new VMSRpc($pub,$usr, $pwd);
$arProps=array('query' => 'type:mediaclip','limit' => '10', 'sort' =>'createddate desc');
$r=json_decode($vms->json('search',null,$arProps));

3.3 XML

Execute API request/action and return the result in XML format.

string xml(string $entity, int $objectId=null, array $arProps=null)

$entity: The relevant api entity that you want to query to obtain the desired result. For example mediaclip, mediacliplist, publication or playout.

$objectId: (optional) The id of a certain entity, for example the mediaclipid. If $objectId is set the action will become 'get'.

$arProps: (optional) This array contains required or optional properties needed for the specific request. If not set the default action will become 'get'.

Below an example to get global configurations of a publication.

include('bootstrap.php');
$usr = 'UserName';
$pwd = 'Password';
$pub = 'http://YourPublication.bbvms.com'; 

$vms=new VMSRpc($pub,$usr, $pwd);
$r = $vms->xml('publication');

3.4 URI

Execute an API request/action and send all properties for the specific request on the query string. This may be useful whether multiple properties with the same key need to be provided, which could be the case for Solr requests.

string uri(string $apiEntityUrl, string $qs=null)

$apiEntityUrl: The relevant api entity that you want to query to obtain the desired result. For example json/mediaclip or json/qstats.

$qs: (optional) The Query String to be send with the request'.

Below an example to get the mainconfig.xml, which contains configuration of your publication such as asset-paths.

include('bootstrap.php');
$usr = 'UserName';
$pwd = 'Password';
$pub = 'http://YourPublication.bbvms.com'; 

$vms=new VMSRpc($pub,$usr, $pwd);

$apiEntityUrl = "";
$qs = 'mainconfig.xml';

$r = $vms->uri($apiEntityUrl, $qs);