croscon / commissionjunction-php
A Commission Junction PHP API Library
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: >=5.3.2
- ext-curl: *
This package is not auto-updated.
Last update: 2020-08-07 18:03:50 UTC
README
Installation
Composer
Simply add the CommissionJunction API library to your composer.json
file:
{ "require": { "croscon/commissionjunction-php": "dev-master" } }
Configuration
The API library simply needs your Commission Junction developer key (which can be obtained at https://api.cj.com/sign_up.cj).
<?php $client = new \CROSCON\CommissionJunction\Client($api_key);
Usage
Commission Junction's API documentation can be found here.
The API library provides a generic api($subdomain, $resource, array $params = array(), $version = 'v2')
method that accepts the subdomain, resource name, GET parameters, and optionally the api version number. When you view an individual REST service's documentation page, you will see a sample URI at the top of the page. The URI maps to the api(...)
method as follows:
https://SUBDOMAIN.api.cj.com/VERSION/RESOURCE?PARAMS
Alternatively the library provides a few convenience methods for the major resources listed in the documentation:
<?php $client->productSearch($parameters); $client->linkSearch($parameters); $client->publisherLookup($parameters); $client->advertiserLookup($parameters); $client->supportLookup($resource, $parameters);
Each method corresponds to the individual resource documentation pages found under the "REST APIs" section.