Sample PHP code for Reporting
The following sample PHP code is an example of Reporting, using Device, IFA, MAC, ODIN, Token and Nonce.
 

<?php

$api = 'http://api2.playhaven.com/v3/advertiser/open?';

$app_secret = 'secret';

$params = array(

    'device' => '1111',

    'd_ifa' => '2222',

    'd_mac' => 'beefbeefbeef',

    'd_odin' => '3333',

    'token' => 'token',

    'nonce' => 'nonce'

);

function sign_v4($params, $secret) {

    $sig_keys = array('device', 'd_ifa', 'd_mac', 'd_odin',

                      'token', 'nonce');

    $sig_params = array();

    foreach($sig_keys as $key) {

        if (array_key_exists($key, $params)) {

            array_push($sig_params, $params[$key]);

        }

    }

    $sig = implode(':', $sig_params);

    echo $sig;

    $sig = base64_encode(hash_hmac("sha1", $sig, $secret, true));

    $sig = str_replace(array('+', '/', '='), array('-', '_', ''), $sig); 

    return $sig;

}

$params['sig4'] = sign_v4($params, $app_secret);

$url = $api . http_build_query($params);

echo $url;

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);

curl_close($ch);

echo $result;

# HTTP response: 200 OK

# HTTP body: ['{"errobj": null, "response": {}, "error": null}']

?>