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.
content property will provide a link to a PDF file.
model property contains a JSON representation of the relevant model.
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.
content property.