# DownloadReport

Download a report

`GET /api/v2/reports/{id}/attachment`

**API:** AvaTax API
**Tag:** Reports
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Reports/DownloadReport/

## Description

This API downloads the file associated with a report.
            
If the report is not yet complete, you will receive a `ReportNotFinished` error.  To check if a report is complete,
use the `GetReport` API.
            
Reports are run as asynchronous report tasks on the server.  When complete, the report file will be available for download
for up to 30 days after completion.  To run an asynchronous report, you should follow these steps:
            
* Begin a report by calling the report's Initiate API.  There is a separate initiate API call for each report type.
* In the result of the Initiate API, you receive back a report's `id` value.
* Check the status of a report by calling `GetReport` and passing in the report's `id` value.
* When a report's status is `Completed`, call `DownloadReport` to retrieve the file.
            
* We throttle this API. You can only call this API up to 5 times in a minute.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `id` | integer | path | Yes | The unique ID number of this report |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | OK |  |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/reports/{id}/attachment" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```