> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extole.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use the Extole Asynchronous Reporting API

> Extole provides asynchronous API endpoints to download various reports. To run, check the status of, and download a report, you need to make calls across three API endpoints.

# Overview

Extole provides asynchronous API endpoints to download various reports. To run, check the status of, and download a report, you need to make calls across three API endpoints.

# Setup

## Generate an access token

Get your access token. To generate a long-lived access token, follow the documentation here: [Generating Long-Lived Access Tokens](https://docs.extole.com/docs/generate-long-lived-access-tokens#generate-your-token).

## Execute a report

```
POST https://api.extole.io/v4/reports
```

With these HTTP Headers:

```
Authorization: <ACCESS_TOKEN>  
Content-Type: application/json
```

With this Body:

```
{    
   "name":"<REPORT_NAME>",  
   "format":"<FORMAT>",  
   "parameters":{    
      "date_range":"<DATE_RANGE.START>/<DATE_RANGE.END>"   }  
}
```

Options for parameters above:

* **\<REPORT\_NAME>**: Name of report you want to download. Available reports are listed here: [How to Run Data Reports](/guides/dashboards-and-reporting/how-to-run-a-report)
* **\<FORMAT>**: JSON, CSV
* **\<DATE\_RANGE.START>**: Any start date for the report range. Takes format YYYY-MM-DD
* **\<DATE\_RANGE.END>**: Any end date for the report range. Takes format YYYY-MM-DD

**Note:** Different reports require different parameters. To find out exactly how your API call should look, first run the report in [My Extole](https://my.extole.com/reports). Then, you can click the three dots from the reports listing page and select "GET API Call":

<img src="https://mintcdn.com/extole/m8INyJRwaO8CRdkT/images/extole/e114e1e27ec1c321306d29a4ddfc84b736632f2196470dab624e6b198a0d6c25.png?fit=max&auto=format&n=m8INyJRwaO8CRdkT&q=85&s=91470979f413a1168d6bad484557c460" alt="Screenshot showing Note: Different reports require different parameters. To find out exactly how your API call should look, first run the report in My Extole. Then, you can..." width="323" height="340" data-path="images/extole/e114e1e27ec1c321306d29a4ddfc84b736632f2196470dab624e6b198a0d6c25.png" />

Alternatively, you can click into the report itself and click the "Get API Call" button.

<img src="https://mintcdn.com/extole/jfiwIeVafuhmrxvP/images/extole/f342220cf948e72554127341b490d2e5c6682b94e0805cb6c9ec6e4bf8dcfc8f.png?fit=max&auto=format&n=jfiwIeVafuhmrxvP&q=85&s=8a243582c5e2ea4d301a7cd097d6b881" alt="Screenshot showing Alternatively, you can click into the report itself and click the &#x22;Get API Call&#x22; button." width="1126" height="376" data-path="images/extole/f342220cf948e72554127341b490d2e5c6682b94e0805cb6c9ec6e4bf8dcfc8f.png" />

<img src="https://mintcdn.com/extole/jfiwIeVafuhmrxvP/images/extole/f64621ec8152f1dfbc3941a9a840f5f053246ec1fa4f34997dbcdba12959a321.png?fit=max&auto=format&n=jfiwIeVafuhmrxvP&q=85&s=c227ab28d274d81516636313575bd965" alt="Screenshot showing Alternatively, you can click into the report itself and click the &#x22;Get API Call&#x22; button." width="829" height="965" data-path="images/extole/f64621ec8152f1dfbc3941a9a840f5f053246ec1fa4f34997dbcdba12959a321.png" />

For scheduled reports, the "Get API Call" button on the schedules page will give you the latest version of the scheduled report:

<img src="https://mintcdn.com/extole/qcEY2oecClXIoahB/images/extole/7cb0a8ea7ecdcb2f314733bb10606b760fa1f6a5633512d99176f4aca958784f.png?fit=max&auto=format&n=qcEY2oecClXIoahB&q=85&s=8a6e2b621b7072b06bbad30a26393dcf" alt="Screenshot showing For scheduled reports, the &#x22;Get API Call&#x22; button on the schedules page will give you the latest version of the scheduled report" width="1123" height="305" data-path="images/extole/7cb0a8ea7ecdcb2f314733bb10606b760fa1f6a5633512d99176f4aca958784f.png" />

<img src="https://mintcdn.com/extole/jL8qwWMZhH32a7N8/images/extole/4741fbee7c45b96c4c597a8c910aac282f63fd873dea4f50651f33b7242e83ab.png?fit=max&auto=format&n=jL8qwWMZhH32a7N8&q=85&s=39558592fea94e1bf50c801f6c89931e" alt="Screenshot showing For scheduled reports, the &#x22;Get API Call&#x22; button on the schedules page will give you the latest version of the scheduled report" width="792" height="850" data-path="images/extole/4741fbee7c45b96c4c597a8c910aac282f63fd873dea4f50651f33b7242e83ab.png" />

A successful output will look like this:

<img src="https://mintcdn.com/extole/m8INyJRwaO8CRdkT/images/extole/e82068446dc0785cf4529dc263fa1768363d88a9de17ee79814df9b5e76e9fa7.png?fit=max&auto=format&n=m8INyJRwaO8CRdkT&q=85&s=15dbcd5c0759a75f1c80cdca4356f38a" alt="Screenshot showing A successful output will look like this" width="427" height="329" data-path="images/extole/e82068446dc0785cf4529dc263fa1768363d88a9de17ee79814df9b5e76e9fa7.png" />

## Check the Status of a Report

There are four options for the status of the report.

* **Pending**: The report is preparing to run.
* **In progress**: The report is initialized and in progress. Depending on the amount of data you pull back, reports typically remain in this status for one to ten minutes.
* **Failed**: There was an error in the API call.
* **Done**: The report is complete and ready to be downloaded.

From the output above, copy and paste the report ID. Remove the quotes.

```
GET https://api.extole.io/v4/reports/<REPORT_ID>
```

A successful output will look like this:

<img src="https://mintcdn.com/extole/wCoosrNLYZq4SH58/images/extole/a7fb7ef0f9237151d9a882a7532b2a7a93a05f11d87d8c90ede43eb35ee82fb0.png?fit=max&auto=format&n=wCoosrNLYZq4SH58&q=85&s=7fe6f18846b538b130797330a93b574e" alt="Screenshot showing A successful output will look like this" width="883" height="417" data-path="images/extole/a7fb7ef0f9237151d9a882a7532b2a7a93a05f11d87d8c90ede43eb35ee82fb0.png" />

## Download the Report

Once the status reads "DONE" you will be able to download your report.

```
GET https://api.extole.io/v4/reports/<REPORT_ID>/download
```
