Download export file

The export API allows you to download files extracted by your export request.

API Description

Download

get

Download the extraction file of an export request. Status of the export must be SUCCESS to call this API. See view export API to get the current status of your export. The link to the JSON file that you can found under the Location section of the response header will expire after 20 minutes. You will need to call this API again to generate a new file.

Authorizations
AuthorizationstringRequired

API Key Authentication

Authentication is required in order to interact with Batch's APIs.

Batch implements authentication using API Keys, that we call the "REST API Key". You can find it on your dashboard.

Please make sure that you keep this key secret. You should never use it in client apps to call APIs from there as it would easily be extractable.

How to authenticate

In order to authenticate your requests, add your REST API Key in the Authorization header and prefix it by Bearer. Example: Authorization: Bearer bcd38d9rfb38ra28.

Query parameters
idstringRequired

ID of the file to be downloaded.

Example: file_063bc4w4x8e363yem6wfnxc5c13c0n46
Header parameters
X-Batch-ProjectstringRequired

The unique project key, identifying a project on the Batch platform

Example: project_0664hxvwffvbpn278gxdyhsadddqgna6
Responses
get
/exports/download
GET /2.8/exports/download?id=text HTTP/1.1
Host: api.batch.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-Batch-Project: text
Accept: */*

No content

Route

The Project Export API exposes a GET endpoint that allows to download result files:

/exports/download

Headers and authentication

See Overview → Using Project APIs.

Success

Batch will respond with an HTTP status code: 307. The download link is located under the location section of the response header.

The link to the file will expire after 20 minutes. You will need to call again the API to generate a new file.

Failure

If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.

See the list of potential failures in the API Description.

Last updated