<commit_before># Exads API PHP Client

A simple Object Oriented wrapper for Exads API, written with PHP5.

See Exads API's documentation.

## 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](http://php.net/manual/en/book.curl.php) extension
* The PHP [JSON](http://php.net/manual/en/book.json.php) extension
* [PHPUnit](https://phpunit.de/) >= 4.0 (optional) to run the test suite

## Install

### Composer

[Composer](http://getcomposer.org/download/) users can simply run:

```bash
$ php composer.phar require exads/exads-api-client-php:~1.0
```

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.

For example,

```php
<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new Exads\Client('https://api.exads.com/url/');
// ...
```

### Standalone (not recommended)

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


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

Then your bootstrap script should look like :

```php
<?php

// This file ships with the library
require 'vendor/exads-api-client-php-1.0.0/lib/autoload.php';
$client = new Exads\Client('https://api.exads.com/url/');
```

## Basic usage of `exads-api-client-php` client


```php
<?php

require_once 'vendor/autoload.php';

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

    // 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());<commit_msg>Change examples into correct API urls<commit_after># Exads API PHP Client

A simple Object Oriented wrapper for Exads API, written with PHP5.

See Exads API's documentation.

## 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](http://php.net/manual/en/book.curl.php) extension
* The PHP [JSON](http://php.net/manual/en/book.json.php) extension
* [PHPUnit](https://phpunit.de/) >= 4.0 (optional) to run the test suite

## Install

### Composer

[Composer](http://getcomposer.org/download/) users can simply run:

```bash
$ php composer.phar require exads/exads-api-client-php:~1.0
```

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.

For example,

```php
<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new Exads\Client('https://api.exoclick.com/v1/');
// ...
```

### Standalone (not recommended)

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


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

Then your bootstrap script should look like :

```php
<?php

// This file ships with the library
require 'vendor/exads-api-client-php-1.0.0/lib/autoload.php';
$client = new Exads\Client('https://api.exoclick.com/v1/');
```

## Basic usage of `exads-api-client-php` client


```php
<?php

require_once 'vendor/autoload.php';

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

    // 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());
{'fraction_non_alphanumeric': 0.15659461843846492, 'fraction_numerical': 0.009483899426554919, 'mean_word_length': 3.5715725806451615, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2158905', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1500, 'n_words': 416}