Use this endpoint to get analytics data per outstream unit.
apiv2/stats/partner/outstreams/<UNIT_ID>.json
This method is type of POST and will not receive any GET parameters.
UNIT_ID is an integer ID of your outstream unit in Brid CMS.
Parameters:
Name | Type | Description |
---|---|---|
data[date_from] *required | string | Starting date |
data[date_to] *required | string | End date |
data[metric] *required | string | Accepted values: Ad requests,Ad slot,Fill rate,Ad errors,Overview,OS,Browser,Social,Geography,Traffic Sources |
data[filter] *required | string | Accepted values: all,mobile,desktop |
data[results] *required | string | Accepted values: by day,total |
data[os_browser] *required | string | Accepted values: All,Windows,Android,iOS,MacOS,Linux,other-os,Firefox,Chrome,Internet Explorer,Opera,Safari,Facebook,other-browser |
Date format should be in: "YYYY-MM-DD".
<?php
require_once('lib/BridApi.php');
try{
$api = new BridApi(array('auth_token'=>'b1437c94847d7e19268ad3bda0e46f8f6bc36f45'));
$post = array('data[date_from]'=>'2019-08-01', 'data[date_to]'=>'2019-08-09', 'data[metric]'=>'Ad requests', 'data[filter]'=>'all', 'data[results]'=>'by day','data[os_browser]'=>'All');
$return = $api->post(['stats', 'partner', 'outstreams', 9888], $post);
print_r($return);
}
catch(Exception $e) {
echo $e->getMessage();
}
BridApi.php is a small library we provide in our git repository which allows you to quick-start your implementation so we advise you to use it. These examples are made with this library in mind. Make sure to substitute and use your own authorization token and Unit ID when trying out these examples.