Skip to content
Last updated

Company Report Response Formats

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.


Supported Accept Header Values

The following table outlines the supported Accept header values and their corresponding output formats:

Accept Header ValueDescription
application/jsonThe default. Retrieves the report as JSON.
application/pdfRetrieves the report as a PDF file.
application/htmlRetrieves the report as an HTML page.
application/json+pdfRetrieves the JSON report, with the PDF as base64 in pdfReportStream.
application/json+htmlRetrieves the JSON report, with the HTML as base64 in htmlReportStream.
application/pdf+htmlRetrieves the report as a PDF file only.

How to Use

To specify the desired format, include the appropriate Accept header value in your API request. For example:

Example Request

GET /companies/{connectId}
Accept: application/json+pdf
Authorization: Bearer {accessToken}

Best Practices

  1. Choose the Right Format: Select the format that aligns with your use case. For example:

    • Use application/pdf for a downloadable, shareable report.
    • Use application/json for programmatic processing of report data.
  2. Combine Formats When Needed: If you need both a machine-readable format and a human-readable format, use application/json+pdf or application/json+html. application/pdf+html doesn't combine formats: it returns the PDF only.

  3. Test Your Integration: Ensure that your application can handle the selected format(s) correctly by testing the API response with different Accept header values.

By leveraging the flexibility of the Accept header, you can tailor the Company Report API to meet your specific reporting and integration requirements.