Get Download URL
Get download URL
Contents
- Overview
- Version-specific information
- Permissions and Authentication
- Headers
- URL parameters
- Sample request
- Sample response
- Possible error responses
Overview
- Endpoint URL:
https://{Services API hostname}/tasks/{id}/download_url - Request method: HTTP GET
- Response Content-Type: application/json
- Auth required: yes
Request a temporary, pre-signed download URL for the result file of a completed export task. The URL expires after approximately one hour.
This endpoint only works for export tasks (where target.action is "export") and only when the task state is DONE.
Version-specific information
The following version-specific changes apply to this endpoint:
| Version | Change details |
|---|---|
| N/A | N/A |
Permissions and Authentication
This endpoint requires chain-scoped authentication on the Services API. See the authentication page for more details on authentication methods. The following authentication types are permitted:
- Privileged authentication: the use of privileged authentication is permitted for this endpoint.
- Admin authentication: the use of admin authentication is permitted. The performing user needs to have the appropriate access level for the chain.
Headers
The following headers can/must be passed to the API call:
| Parameter | Description |
|---|---|
| N/A | N/A |
URL parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | required | The ID of the task. |
Sample request
curl 'https://{Services API hostname}/tasks/12345/download_url' \
-H 'Authorization: Bearer ACCESS_TOKEN_ID:ACCESS_TOKEN_SECRET'
Sample response
Returns a JSON object containing the temporary download URL.
| Field | Type | Description |
|---|---|---|
url | string | Pre-signed URL for downloading the export file. Valid for approximately one hour. |
{
"url": "https://{storage URL}/Wallet_Export-12345.csv?..."
}
The file name in the URL follows the pattern {Index}_Export-{task_id}.{extension}, for example:
Transaction_Export-12345.csvUser_Export-12346.csvVoucher_Export-12347.json
Possible error responses
The following represents a list of possible error responses for this endpoint:
| Condition | Description |
|---|---|
| Task is not an export task | invalid task type: only export tasks actions are allowed |
Task state is not DONE | task status is not DONE |
| No result file available | the task completed successfully, but contains an invalid result |
| Task not found | No task exists with the specified ID for this chain. |
| Authentication failure | No valid authentication provided or insufficient permissions. |