2017 © Pedro Peláez
 

library exads-api-client-php

Exads API client

image

exads/exads-api-client-php

Exads API client

  • Tuesday, October 3, 2017
  • by kbsali
  • Repository
  • 20 Watchers
  • 12 Stars
  • 3,985 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 5 Open issues
  • 11 Versions
  • 33 % Grown

The README.md

Exads API PHP Client

A simple Object Oriented wrapper for Exads API, written with PHP5., (*1)

See Exads API's documentation., (*2)

Features

  • Follows PSR-0 conventions and coding standard: autoload friendly
  • API entry points implementation state :
    • Campaign
    • Collection
    • Login
    • Payment
    • Site
    • Statistics
    • User
    • Zones

Requirements

  • PHP >= 5.4
  • The PHP cURL extension
  • The PHP JSON extension
  • PHPUnit >= 4.0 (optional) to run the test suite

Install

Composer

Composer users can simply run:, (*3)

$ composer require exads/exads-api-client-php

at the root of their projects. To utilize the library, include Composer's vendor/autoload.php in the scripts that will use the Exads classes., (*4)

For example,, (*5)

<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';

$client = new Exads\Client('https://api.exoclick.com/v2/');
// ...

The library ships with a basic autoload.php file which allows you to use it without composer. See the latest version available : https://github.com/EXADS/exads-api-client-php/releases, (*6)

$ mkdir vendor
$ wget -q https://github.com/EXADS/exads-api-client-php/archive/v1.3.0.tar.gz
$ tar -xf v1.3.0.tar.gz -C vendor/
$ rm v1.3.0.tar.gz

Then your bootstrap script should look like :, (*7)

<?php

// This file ships with the library
require 'vendor/exads-api-client-php-1.2.2/lib/autoload.php';

$client = new Exads\Client('https://api.exoclick.com/v2/');

Basic usage of exads-api-client-php client

<?php

require_once 'vendor/autoload.php';

try {
    $client = new Exads\Client('https://api.exoclick.com/v2/');

    // There are two authentication methods:
    // a. with username and password
    $sessionToken = $client->login->getToken('username', 'password');
    // b. with APItoken
    // $sessionToken = $client->login->getToken('APItoken');

    $client->setApiToken($sessionToken);
    // ...
    $campaigns = $client->campaigns->all();
    // ...
} catch (\Exception $e) {
    die($e->getMessage());
}

See test/Exads/Tests/UrlsTest.php for a full list of available methods., (*8)

Passing parameters to end points

As describe in the API documentation, most of the GET entry points accept parameters for filtering the result of the call. In particular, for long collections, you should use offset for paginating the results the API returns (you cannot get more than 50 elements out of 1 call, that's when offset comes in play). See the following examples :, (*9)

<?php
...

// Getting the total number of carriers
$client->collections->carriers(array('count' => true));

// Getting the carriers 50..100
$client->collections->carriers(array('offset' => 50));

Please refer to the documentation for the full list of parameters allowed for each entry point., (*10)

The Versions

03/10 2017

dev-master

9999999-dev https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

api exads

24/05 2016

v1.2.2

1.2.2.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

api exads

17/02 2016

v1.2.1

1.2.1.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

api exads

17/02 2016

dev-campaign_groups

dev-campaign_groups https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

api exads

08/01 2016

v1.2.0

1.2.0.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

api exads

20/10 2015

v1.1.2

1.1.2.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

The Development Requires

api exads

07/10 2015

v1.1.1

1.1.1.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

The Development Requires

api exads

14/09 2015

v1.1.0

1.1.0.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

The Development Requires

api exads

07/05 2015

v1.0.2

1.0.2.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

The Development Requires

api exads

26/03 2015

v1.0.1

1.0.1.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

The Development Requires

api exads

06/03 2015

v1.0.0

1.0.0.0 https://github.com/EXADS/exads-api-client-php

Exads API client

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

The Development Requires

api exads