Table of Contents
...
<?php
$url = "https://via.digitalturbineappia.com/ext/api/reports/subsites?siteId=XXXX";
$creds = "example@digitalturbine.com:digitalturbine123";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HTTPHEADER,array('Authorization: Basic ' . base64_encode($creds)));
$result = curl_exec($c);
curl_close($c);
?>
...
Digital Turbine's reporting is rolled up hourly, so it's recommended that queries be scheduled at most once per hour, at a staggered time so all Publisher requests are not at the top of the hour, thereby reducing response times.
Request
...
URL
https://via.digitalturbineappia.com/ext/api/reports/subsites
*Please note, Appia endpoints will continue to work (i.e. ..via.appia..)
Headers
Parameter | Required | Description |
---|---|---|
Accept Header | No | XML and JSON are supported |
Authorization | Yes | See Authentication section above |
Request Parameters
Parameter | Required | Description |
---|---|---|
siteId | No | ex. https://via. |
appia.com/ext/api/reports/subsites?siteId=9999 If not passed in, API will return results for all of your sites | ||
subSite | No | ex. https://via. |
appia.com/ext/api/reports/subsites?siteId=9999&subSite=test The subSite value that was passed in on the ad request or click Requires SiteId If not passed in, API will return results for all of your sub-sites | ||
startDate | No | ex. https://via. |
appia.com/ext/api/reports/subsites?startDate=2014-01-01 Requires End Date yyyy-mm-dd | ||
endDate | No | ex. https://via. |
appia.com/ext/api/reports/subsites?startDate=2014-01-01&endDate=2014-01-31 Requires Start Date yyyy-mm-dd Max 31 day range in 1 API request |
Response
...
Data Returned
Field | Description |
---|---|
date | Date values will use ISO-8601 compliant short notation, YYYY-MM-DD |
siteId | The a unique url for this campaign, to access this API for only this campaign |
campaignId | The unique numeric id for the campaign |
subSite | The subSite value that was passed in on the ad request or click |
impressionCount |
|
clickCount |
|
installCount |
|
revenue |
Sample Response
Code Block | ||||
---|---|---|---|---|
| ||||
{ "data": [ { "date": "2014-04-08", "sites": [ { "siteId": 9998, "impressionCount": 250, "clickCount": 25, "installCount": 25, "revenue": 29, "campaigns": [ { "campaignId": 5555, "impressionCount": 150, "clickCount": 18, "installCount": 18, "revenue": 5.76, "subSites": [ { "subSite": "Test", "impressionCount": 100, "clickCount": 7, "installCount": 5, "revenue": 1.6 }, { "subSite": "123Example", "impressionCount": 30, "clickCount": 7, "installCount": 6, "revenue": 1.92 } ] }, { "campaignId": 9999, "impressionCount": 100, "clickCount": 7, "installCount": 7, "revenue": 23.24, "subSites": [ { "subSite": "123Example", "impressionCount": 90, "clickCount": 6, "installCount": 6, "revenue": 19.92 } ] } ] } ] }, { "date": "2014-04-09", "sites": [ { "siteId": 9998, "impressionCount": 250, "clickCount": 25, "installCount": 25, "revenue": 29, "campaigns": [ { "campaignId": 5555, "impressionCount": 150, "clickCount": 18, "installCount": 18, "revenue": 5.76, "subSites": [ { "subSite": "Test", "impressionCount": 100, "clickCount": 7, "installCount": 5, "revenue": 1.6 }, { "subSite": "123Example", "impressionCount": 30, "clickCount": 7, "installCount": 6, "revenue": 1.92 } ] }, { "campaignId": 9999, "impressionCount": 100, "clickCount": 7, "installCount": 7, "revenue": 23.24, "subSites": [ { "subSite": "123Example", "impressionCount": 90, "clickCount": 6, "installCount": 6, "revenue": 19.92 } ] } ] } ] } ] } |
...