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/pdf | Retrieves the report in PDF format. |
application/pdf+html | Retrieves the report in both PDF and HTML formats. |
application/json+pdf | Retrieves the report in both JSON and PDF formats. |
application/json+html | Retrieves the report in both JSON and HTML formats. |
application/html | Retrieves the report in HTML format. |
To specify the desired format, include the appropriate Accept header value in your API request. For example:
GET /company-report/{companyId}
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 combined options like
application/json+pdforapplication/json+html.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.