An OOP implementation af the Appnexus API.
To use this package, use composer:
- from CLI:
composer require Audiens/appnexus-client
- or, directly in your
composer.json
:
{
"require": {
"Audiens/appnexus-client": "dev-master"
}
}
require 'vendor/autoload.php';
$username = '{yourUsername}';
$password = '{yourPassword}';
$memberId = '{yourPassword}';
$appnexus = new AppnexusFacade($username, $password, $memberId);
// Segment creation example
$segment = new Segment();
$segment->setName('Male');
$segment->setMemberId($memberId);
$segment->setActive(true);
$repositoryResponse = $appnexus->add($segment);
if ($repositoryResponse->isSuccessful()){
echo "Success!";
}
The client implement a simple cache service using doctrine/cache.By default is enabled but you can disabled it with:
require 'vendor/autoload.php';
$username = '{yourUsername}';
$password = '{yourPassword}';
$memberId = '{yourPassword}';
$appnexus = new AppnexusFacade($username, $password, $memberId);
$appnexus->disableCache();