The PHP client for Adzerk REST API

v0.1.1 2014-06-03 13:34 UTC


PHP Client for Adzerk REST API

Adzerk thin client (

Copyright (c) 2013 PositiveZero ltd. (

For the full copyright and license information, please view the file that was distributed with this source code.



$adzerk = new Adzerk(API_KEY)
$response = $adzerk->site()->get();

First of all, you have to select api method (advertiser, channel, site etc.). All methods are documented in Adzerk class annotation.



This will return Adzerk\Wrapper object, which do rest - Send curl request and return response. @see \Positivezero\RestClient

$adzerk->channel(/*optional*/ $id)->get()

You have to define all required properties in annotation. Validation before post/put is automatic.

example of list all Channels

$list = $adzerk->channel()->get();

or get some spcecific item

$list = $adzerk->channel(5541)->get();

example of creating Channel:

$object = $adzerk->channel();
$object->Id = 0;
$object->Title = 'Some name';
$object->AdTypes = array(1,3,4);
$object->Engine = 'CPM';
$object->CPM   = 10.00;
$response = $object->create();

example of updating Channel:

$object = $adzerk->channel(5541);
$object->Title = 'Some name';
$object->CPM   = 10.00;
$response = $object->update();

example of removing Channel:

$object = $adzerk->channel(5541);

it will generate endpoint url like:

and put this object as string:

channel={"Id":15311,"Title":"Some name","AdTypes":[1,3,4],"Engine":"CPM","CPM":10}

All responses are returned by default, as an associative PHP array