The Company Report API allows you to retrieve reports in various formats by modifying the Accept header in your request. This flexibility ensures that you can receive the report in the format that best suits your business needs.
The following table outlines the supported Accept header values and their corresponding output formats:
| Accept Header Value | Description |
|---|---|
application/json | The default. Retrieves the report as JSON. |
application/pdf | Retrieves the report as a PDF file. |
application/html | Retrieves the report as an HTML page. |
application/json+pdf | Retrieves the JSON report, with the PDF as base64 in pdfReportStream. |
application/json+html | Retrieves the JSON report, with the HTML as base64 in htmlReportStream. |
application/pdf+html | Retrieves the report as a PDF file only. |
To specify the desired format, include the appropriate Accept header value in your API request. For example:
GET /companies/{connectId}
Accept: application/json+pdf
Authorization: Bearer {accessToken}Choose the Right Format: Select the format that aligns with your use case. For example:
- Use
application/pdffor a downloadable, shareable report. - Use
application/jsonfor programmatic processing of report data.
- Use
Combine Formats When Needed: If you need both a machine-readable format and a human-readable format, use
application/json+pdforapplication/json+html.application/pdf+htmldoesn't combine formats: it returns the PDF only.Test Your Integration: Ensure that your application can handle the selected format(s) correctly by testing the API response with different
Acceptheader values.
By leveraging the flexibility of the Accept header, you can tailor the Company Report API to meet your specific reporting and integration requirements.