Aller au contenu principal

Mediation 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.

breakdowncommentDefault?
DAILYProvides a breakdown by day (can't be combined with HOURLY, RANGE and DAILY)No
HOURLYProvides a breakdown by hour (can't be combined with MONTHLY, RANGE and DAILY)No
MONTHLYProvides a breakdown by Month (can't be combined with HOURLY, RANGE and DAILY)No
RANGEProvides a breakdown according since and until dates (can't be combined with HOURLY, MONTHLY and DAILY)No
ADNETWORKProvides a breakdown by our core Ad network (mngperf or appsfire)No
PUBLISHERProvides a breakdown by PublisherNo
APPProvides a breakdown by AppNo
PLACEMENTProvides a breakdown by placement (banner, Interstitial, NativeAd, ...)No
FORMATProvides a breakdown by format (interstitial, banner, nativeAd ...)No
COUNTRYProvides a breakdown by country (FR, IT, DE), not end-user country but country of Madvertise Office
APP_MEDIATION1 = uur mediation SDK, 0 = our adserving platform
APP_STATONLY1 = stats from other adnetworks without our mediation SDK

POST /mediation-reporting : Publisher Reporting Service

Use the token returned by auth-reporting service when making calls to

Parameters

Parameter nameRequired?FormatDescription
sinceYeseurope/paris unix timestampe.g 1417392000
untilYeseurope/paris unix timestampe.g 1420070399
breakdownsNoarray of stringsee [breakdowns-list section], e.g breakdowns[0]=HOURLY&breakdowns[1]=ZONE
publisherIdnoarray of publishers IDsFor admin only Filter reporting on specific publishers e.g publisherId[0]=1&publisherId[1]=2
appIdnoarray of apps IDsFilter reporting on specific apps e.g appId[0]=1&appId[1]=2
placementIdnoarray of placements IDsFor admin only Filter reporting on specific placements e.g placementId[0]=1&placementId[1]=2
formatIdnoArray of formatFilter reporting on a specific placement format [formats-list] e.g formatId[0]=1&formatId[1]=2
adNetworknoFilter reporting on a specific Ad networkse.g smartAdserver, Facebook
app_statonlyno1 = stats from other adnetworks without our mediation SDK
app_mediationno1 = uur mediation SDK, 0 = our adserving platform
countryCodeno(FR, IT, DE), not end-user country but country of Madvertise Office

Output

{
"data": [
{
"click": "1695",
"request": 181483,
"requestMediation": "1639327",
"impression": "161294",
"breakdowns": {
"publisherId": "5746",
"publisherName": "xxx",
"appName": "xxxxxx",
"appOwner": "MBRAND",
"appId": "1697824",
"date": "2017-10-15"
},
"revenue": "27.553169130999997",
"revenueEuros": "27.114409424918936",
"revenueDollar": "32.0221177026"
},
{
"click": "31",
"request": 45254,
"requestMediation": "249237",
"impression": "25144",
"breakdowns": {
"publisherId": "5746",
"publisherName": "xxx",
"appName": "xxxx",
"appOwner": "MBRAND",
"appId": "1191726",
"date": "2017-10-15"
},
"revenue": "2.56965202",
"revenueEuros": "2.3561616492127997",
"revenueDollar": "2.7826269913"
}
],
"summary": {
"since": "2017-10-15 00:00:00",
"until": "2017-10-16 00:00:00",
"breakdowns": [
"DAILY",
"PUBLISHER",
"APP"
],
"timezone": "europe/paris"
}
}

Example

curl -H 'Authorization: da57722f06c2c4359b03697584a8757c036c1359' -X POST "https://xxxx.com/mediation-reporting" \
--data "since=1508018400&until=1508104800&breakdowns[0]=DAILY&breakdowns[1]=PUBLISHER&breakdowns[2]=APP&publisherId[0]=5746" |json_reformat

Error

{
"response": {
"status": "ERROR",
"message": "Unknown token, use auth service before"
}
}