API applications can be created in the VHX admin or by emailing [email protected].
Requires PHP 5.3.3 and later.
Composer
You can install the bindings via Composer. Add this to your composer.json
:
{
"require": {
"vhx/vhx-php": "1.12.*"
}
}
Then install via:
composer install
Then use Composer's autoload:
require_once('vendor/autoload.php');
Manual
You can also download the latest release. Then simply include the init.php
file.
require_once('/path/to/vhx-php/init.php');
Documentation, including a step-by-step tutorial is available on the VHX Developer Docs site. For Full API reference go here.
Before requesting your first resource, you must setup your instance with your VHX API key:
\VHX\Api::setKey('your VHX API key');
Every resource is accessed via the \VHX
namespace:
// example customer create
$customer = \VHX\Customers::create(array(
email => '[email protected]',
name => 'First Last',
product => 'https://api.vhx.tv/products/1'
));
Headers can be passed in as the last argument, which would either be the second or third argument depending on the method. See each individual method for specifics.
// example video create with header
$video = \VHX\Videos::create(array(
title => 'My Video'
), array(
'VHX-Client-IP' => '0.0.0.0'
));
products
customers
watchlist
watching
browse
videos
collections
authorizations
analytics