Skip to main content

Get Download URL

Get download URL

Contents

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.

note

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:

VersionChange details
N/AN/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:

ParameterDescription
N/AN/A

URL parameters

ParameterTypeRequiredDescription
idintegerrequiredThe 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.

FieldTypeDescription
urlstringPre-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.csv
  • User_Export-12346.csv
  • Voucher_Export-12347.json

Possible error responses

The following represents a list of possible error responses for this endpoint:

ConditionDescription
Task is not an export taskinvalid task type: only export tasks actions are allowed
Task state is not DONEtask status is not DONE
No result file availablethe task completed successfully, but contains an invalid result
Task not foundNo task exists with the specified ID for this chain.
Authentication failureNo valid authentication provided or insufficient permissions.