Publisher Report API with Sub-Sites
Table of Contents
Authentication
The Reporting API uses "Basic Authentication" over SSL to authenticate and authorize users, using your Via login credentials in the Authorization header.
More information about authentication:
http://www.w3.org/Protocols/HTTP/1.0/spec.html#BasicAA
Example:
<?php
$url = "https://via.appia.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);
?>
Frequency
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.appia.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
Error Handling
The API uses a hybrid approach to error handling, relying on custom 5xx HTTP Status Codes for a first error category, then providing additional detail in the response body using the following fields:
- Related entity property: Additional detail on the property of the entity which caused the error. (Example: If the error was caused by an invalid email address, this field would be “emailAddress”)
- User Level Message
- Developer Level Message
- More Info URL: Points to a website where the developer can find out more information to fix the issue.
Sample Error Response