VHX API Client – PHP
PHP Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tests
.gitignore
CHANGELOG.md
LICENSE
README.md
VERSION
composer.json
composer.lock
init.php
tests.sh

README.md

VHX PHP API Client

API applications can be created in the https://www.vhx.tv/admin/platforms or by emailing api@vhx.tv.

Installation

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.11.*"
  }
}

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

Documentation, including a step-by-step tutorial is available on the VHX Developer Docs site. For Full API reference go here.

Getting Started

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 => 'customer@email.com',
  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'  
));

Resources & methods

products

customers

watchlist

watching

browse

videos

collections

authorizations

analytics