Skip to main content

Report API

This is the interface for the mixed-mode ReportService. In synchronous mode, the client provides a report type and optional parameters, and a file is returned.
Unless otherwise stated, the returned file will be in .XLSX format (a zipped directory with XML files) and returned with the Content-Type application/vnd.ms-excel.
In asynchronous mode, the file will be generated one or more times at a later date and will be available from the inbox.

Parameter lists

GET /api/legacy/reports/parameters/templates
GET /api/legacy/reports/parameters/publications

GET/api/legacy/reports/parameters/targets/2 (Gender, localized)
GET/api/legacy/reports/parameters/targets/4(Countries)
GET/api/legacy/reports/parameters/targets/30(Regions)

These all return lists of IdValue, e.g. for gender localized in Dutch

[
{
"id": 2,
"value": "Man"
},
{
"id": 1,
"value": "Niet gekend"
},
{
"id": 3,
"value": "Vrouw"
}
]
GET /api/legacy/reports/parameters/months

Returns a list of months since installation as a List<NameValue> with localized values

[
{
"name": "2014-12-1",
"value": "dec 2014"
},
{
"name": "2014-11-1",
"value": "nov 2014"
},
{
"name": "2014-10-1",
"value": "okt 2014"
},
...
]

Datamine Reports on campaigns and inventory

To retrieve a report blockingly, send a POST request to /api/legacy/reports/generic

namegenerated filelegacy endpointother parameters
revenue.billingyyyyMMdd_CUSTOMER_billing_MONTH.xlsxfacturation.domonths
revenue.publicationyyyyMMdd_CUSTOMER_revenue_publication_MONTH.xlsxconsultOrders.do?groupBy=publicationmonths*, publicationFilter*
revenue.slotyyyyMMdd_CUSTOMER_revenue_position_MONTH.xlsxconsultOrders.do?groupBy=slotmonths*, publicationFilter*
revenue.campaignfile yyyyMMdd_CUSTOMER_revenue_position_MONTH.xlsx (?)consultOrders.do?groupBy=ordermonths*, publicationFilter*
revenue.monthyyyyMMdd_CUSTOMER_revenue_month_MONTH.xlsxconsultPublicationsPerMonth.domonths*, publicationFilter*
revenue.generalgeneral_report_YYYY-MM-DD+HH_MM_SS.xlsx publicationFilter*,startDate (as Long in milliseconds), endDate (as Long in milliseconds)
inventory.monthlyyyyyMMdd_CUSTOMER_average_month_MONTH.xlsxconsultSlotContacts.dopublicationFilter*, from, includeChannels
inventory.dailyadhese-daily-all-templates-DD_mmm_YYYY.xlsxconsultDailySlotContacts.dopublicationFilter*, months*
inventory.daily_simpleyyyyMMdd_CUSTOMER_daily_inventory_MONTH.xlsxconsultDailySlotContactsSimple.dopublicationFilter*, months*
benchmark.publication_simpleyyyyMMdd_CUSTOMER_benchmark_publication_MONTH.xlsxconsultPublicationsContactsSimple.dopublicationFilter*, templateIds*
benchmark.publicationadhese-clicks-per-contacts-impressions.xlsxconsultPublicationsContacts.dopublicationFilter*, templateIds*
benchmark.productadhese-clicks-per-product-impressions.xlsxconsultProductsContacts.dopublicationFilter*, templateIds*
benchmark.averagesyyMMdd_profile-report.xlsxconsultProfileCtr.dotemplateIds*, months*, minAge, maxAge, countryIds*, regionIds*, genderIds*
misc.closing_month (OBSOLETE)adhese-monthly-closing-report-DD_mmm_YYYY.xlsx from
misc.closing_rangeadhese-monthly-closing-report-DD_mmm_YYYY.xlsx startDate, endDate (as Long in milliseconds)
misc.creative_per_dayreport_per_creative_per_day-DD_mmm_YYYY_HH_MM_SS.xlsx startDate, endDate

Examples

curl -O -X POST  -H "Authorization:Bearer <auth_token>"  --data "reportType=inventory.daily&months=2019-10-01&publicationFilter=5" http://foo.adhese.org/api/legacy/reports/generic 

Scheduled PIG / EMR based reports

A number of reports are available that run over longer periods of time. The available reports are listed below. Some reports require parameters, while others do not, depending on the nature of the information they contain. These reports can only be scheduled as they are designed to run over long periods of time. Consequently, they might take a while to be ready for download.

report namedescriptiongenerated filenameparameters
pig.otsGenerates an OTS (Opportunity To See) Report for each campaign running in the given period.adhese-opportunity_to_see-report-dd_MMM_yyyy.csvno parameters needed

Monthly Closing Report

The monthly closing report endpoint has three versions: the default that specifies a range, a version for a single month, and a CSV variant.

GET /api/legacy/reports/monthlyClosingReport/{startDate}/{endDate}
GET /api/legacy/reports/monthlyClosingReport?from={month}
GET /api/legacy/reports/monthlyClosingReport/csv/{startDate}/{endDate}
  • {startDate} and {endDate} are in the format yyyyMMdd 
  • {month} is in the format: yyyy-MM-dd

Invalid start or end date

If the start or end date is in an invalid format, it will result in a 400 status.

Status: 400 Bad Request

No data found

If no data was found, an empty CSV file will be returned because the request was valid but no data was found.

Status: 200 OK

Successful response

If the request is successful, an Excel (or CSV if specified) will be returned in the response body, and a 200 status will be sent.

Status: 200 OK

Creative Per Day Report

The creative per day report has a single endpoint:

GET /api/legacy/reports/reportPerCreativePerDay/{startDate}/{endDate}