Wiki
Clone wikimobile.mng-ads.com-mngperf / location-reporting-api
Location Reporting API
Quick Reference
All API access is over HTTPS, and accessed via the https://xxx.com domain (ask to your Madvertise contact).
Request Format
For POST requests, the request body must be JSON, with the Content-Type header set to application/json.
Response format
The response format for all requests is a JSON object.
Whether a request succeeded is indicated by the HTTP status code. A 2xx status code indicates success, whereas a 4xx status code indicates failure.
Helpful Tools
|json_reformat formats your output nicely without reordering the fields.
POST /auth-reporting : Authentication Service
see auth-reporting
breakdowns list
Optionally, use one of the following options in the breakdowns param to specify which metric.
breakdown | comment | Default? |
---|---|---|
DAILY | Provides a breakdown by day (can't be combined with HOURLY, RANGE and DAILY) | No |
MONTHLY | Provides a breakdown by Month (can't be combined with HOURLY, RANGE and DAILY) | No |
RANGE | Provides a breakdown according since and until dates (can't be combined with HOURLY, MONTHLY and DAILY) | No |
PUBLISHER | Provides a breakdown by Publisher | No |
APP | Provides a breakdown by App | No |
APPCOUNTRY | Provides a breakdown by country (FR, IT, DE), not end-user country but country of Madvertise Office | |
OS | Provides a breakdown by mobile OS | |
SDKVERSION | version of MadvertiseLocation SDK | |
ACCURACY | Average Accuracy of locations |
POST /location-reporting : Location Reporting Service
Use the token returned by auth-reporting service when making calls to
Parameters
Parameter name | Required? | Format | Description |
---|---|---|---|
since | Yes | unix timestamp | e.g 1417392000 |
until | Yes | unix timestamp | e.g 1420070399 |
timezone | no | timezone name [TZ database name] | e.g Europe/Paris |
breakdowns | No | array of string | see [breakdowns-list section], e.g breakdowns[0]=DAILY&breakdowns[1]=APP |
publisherId | no | array of publishers IDs | For admin only Filter reporting on specific publishers e.g publisherId[0]=1&publisherId[1]=2 |
appId | no | array of apps IDs | Filter reporting on specific apps e.g appId[0]=1&appId[1]=2 |
platformId | no | array of platformIds | platformId[0]=1 //ios, platformId[0]=2 //Android |
appCountry | no | (FR, IT, DE), not end-user country but country of Madvertise Office | |
sdkVersion | no | array of platformIds | sdkVersion[0]=v1.0, sdkVersion[0]=v2.0 |
Output
#!json { "data": [ { "publisher": "FR_DEMO", "appName": "FR_DEMO_Location_Android", "date": "2018-12-18", "uniqueUser": 1, "count": 3, "countPerDevice": 3 } ], "summary": { "since": "2018-12-17T16:56:00+0100", "until": "2018-12-19T16:56:28+0100", "breakdowns": [ "DAILY", "PUBLISHER", "APP" ], "timezone": "Europe\/Paris" } }
Example
#!curl curl -H 'Authorization: a70548ba92b4fbb581bda9bf2de1911c26f1a0a4' \ -H 'Accept: application/json' \ -H "Content-Type: application/x-www-form-urlencoded" \ -X POST "https://api.madvertise.com/location-reporting" \ # -X POST "https://xxx.com/location-reporting" \ --data 'output=direct' \ --data 'timezone=Europe/Paris' \ --data 'metrics=count,uniqueUser' \ --data 'breakdowns[0]=DAILY' \ --data 'breakdowns[1]=PUBLISHER' \ --data 'breakdowns[2]=APP' \ --data 'since=1545062160' \ --data 'until=1545234988'
Error
#!json { "response": { "status": "ERROR", "message": "Unknown token, use auth service before" } }
Updated