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

name generated file legacy endpoint other parameters
revenue.billing yyyyMMdd_CUSTOMER_billing_MONTH.xlsx facturation.do months
revenue.publication yyyyMMdd_CUSTOMER_revenue_publication_MONTH.xlsx consultOrders.do?groupBy=publication months*, publicationFilter*
revenue.slot yyyyMMdd_CUSTOMER_revenue_position_MONTH.xlsx consultOrders.do?groupBy=slot months*, publicationFilter*
revenue.campaign file yyyyMMdd_CUSTOMER_revenue_position_MONTH.xlsx (?) consultOrders.do?groupBy=order months*, publicationFilter*
revenue.month yyyyMMdd_CUSTOMER_revenue_month_MONTH.xlsx consultPublicationsPerMonth.do months*, publicationFilter*
revenue.general general_report_YYYY-MM-DD+HH_MM_SS.xlsx   publicationFilter*,startDate (as Long in milliseconds), endDate (as Long in milliseconds)
inventory.monthly yyyyMMdd_CUSTOMER_average_month_MONTH.xlsx consultSlotContacts.do publicationFilter*, from, includeChannels
inventory.daily adhese-daily-all-templates-DD_mmm_YYYY.xlsx consultDailySlotContacts.do publicationFilter*, months*
inventory.daily_simple yyyyMMdd_CUSTOMER_daily_inventory_MONTH.xlsx consultDailySlotContactsSimple.do publicationFilter*, months*
benchmark.publication_simple yyyyMMdd_CUSTOMER_benchmark_publication_MONTH.xlsx consultPublicationsContactsSimple.do publicationFilter*, templateIds*
benchmark.publication adhese-clicks-per-contacts-impressions.xlsx consultPublicationsContacts.do publicationFilter*, templateIds*
benchmark.product adhese-clicks-per-product-impressions.xlsx consultProductsContacts.do publicationFilter*, templateIds*
benchmark.averages yyMMdd_profile-report.xlsx consultProfileCtr.do templateIds*, months*, minAge, maxAge, countryIds*, regionIds*, genderIds*
misc.closing_month (OBSOLETE) adhese-monthly-closing-report-DD_mmm_YYYY.xlsx   from
misc.closing_range adhese-monthly-closing-report-DD_mmm_YYYY.xlsx   startDate, endDate (as Long in milliseconds)
misc.creative_per_day report_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 name description generated filename parameters
pig.ots Generates an OTS (Opportunity To See) Report for each campaign running in the given period. adhese-opportunity_to_see-report-dd_MMM_yyyy.csv no 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}