Reports

We want to provide maximum flexibility for you when consuming reports from the API. So we use a ReportResponse model.

Whenever you request a report, such as a P11 or Papdis File we will examine the accept header to determine how to respond.
The accept headers that are supported can vary from report to report, but they're listed on the relevant page of the API documentation.

The type property of the ReportResponse will contain the accept header you provided. There are two other properties, model and content. Which one contains your response depends on the accept header you provided.

application/pdf

The content property will provide a link to a PDF file.

application/json

The model property contains a JSON representation of the relevant model.

text/html

The content contains a JSON encoded HTML string representing your HTML document. In some cases, such as Payslips there are multiple HTML documents to be returned. In these cases the content property will be blank and the model property will contain an array of JSON encoded HTML strings.

text/csv, text/xml

In cases like these where the content can be represented as a string then the relevant data (csv, xml) will be JSON encoded as a string in the content property.