PHP code example of exads / exads-api-client-php

1. Go to this page and download the library: Download exads/exads-api-client-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

exads / exads-api-client-php example snippets




// This file is generated by Composer
click.com/v2/');
// ...



// This file ships with the library
xoclick.com/v2/');




    $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());
}


...

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

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