Download a report asynchronously

This guide walks you through the process of requesting and downloading reports asynchronously, which is ideal for larger reports that require more processing time.

Before You Start

Ensure you have the following:

Step-by-Step Guide

Step 1: Request a Report

  1. Prepare your request to the appropriate endpoint:
    POST /api/v2/reports/requests/{report-type}

  2. Include these headers:

Content-Type: application/json
Authorization: Bearer {your-access-token}
  1. The response will include a Location field in the header, e.g. Location: api/v2/reports/requests/{request-id}/get-status, allowing you to check the status of your report.

Step 2: Check Report Status

Use the Location header field from the previous step to check status:
GET /api/v2/reports/{request-id}/get-status

Expected responses:

  • 202 Processing: Indicates that the report is being generated. The response header will include a retry-after value in seconds and a Location string indicating the path to check the status again
  • 302 Complete: Indicates that the report has been generated. The response header will include a Location string indicating the path to download the report

Step 3: Download the Report

  1. Once the report status endpoint returns a 302, prepare your download request:
    GET /api/v1/reports/download-report/{reportId}

  2. Include these headers:

Accept: application/json
Authorization: Bearer {your-access-token}

Congratulations! You have now successfully requested and downloaded a report asynchronously.