vhx/vhx-php

VHX PHP API Wrapper

1.12.0 2017-07-31 16:50 UTC

README

API applications can be created in the VHX admin 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.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

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