Getting Started

Download location: https://packagist.org/packages/bluebillywig/vmsrpc

First include the VMSRPC via composer.

composer require bluebillywig/vmsrpc;

 

Create a new instance of BlueBillywig\RPC. This can be done by providing the username and password or the shared secret.

A shared secret can be generated by going to https://YourPublication.bbvms.com/ovp/#/publication/api-keys (where YourPublication needs to be substituted with the name of your publication) and clicking CREATE NEW KEY.

Creating instance with username and password

use BlueBillywig\VMSRPC;

$host = 'https://YourPublication.bbvms.com';
$user = 'UserName';
$password = 'Password';

$vms = new RPC($host, $user, $password);

Creating instance with shared secret

use BlueBillywig\VMSRPC;

$host = 'https://YourPublication.bbvms.com';
$sharedSecret = 123-1234567890abcdefghijklmnopqrstuv;

$vms = new RPC($host, null, null, $sharedSecret);

Quick start

The following example demonstrates how to search for a couple of mediaclips and immediately print the embed code for each mediaclip:

$arProps = array(
    'query' => 'type:mediaclip AND status:published',
    'limit' => '10',
    'sort' =>'createddate desc'
);

// Search action
$search_result = json_decode($vms->json('search', null, $arProps));

if($search_result->count > 0) {
    foreach($search_result->items as $oMc) {            
        echo '<script type="text/javascript" src="https://YourPublication.bbvms.com/p/default/c/'.$oMc->id.'.js"></script>';
    }
}