download_dataset_file

DatasetsApi.download_dataset_file(filename, id, role_id, action=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Presigned url for file download

Returns a download/preview payload for one file. Query filename is required. action=attachment (default) returns presigned url; action=preview returns inline data for supported types or preview URL. Read-only callers on s3 targets may be checked via TBAC (AUTH-1031). Some archived/skip-LZ/framework states are rejected (DS-1070, GE-1106).

Parameters:
  • filename (str) – File key/name to download or preview. (required)

  • id (str) – Dataset ID containing the file. (required)

  • role_id (str) – Amorphic role ID used for authorization. (required)

  • action (str) – attachment (download URL) or preview (inline/partial content).

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

FileDownload

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /datasets/{id}/files/download

Success (HTTP 200)

Download URL and/or preview data (FileDownload).

Request / response example

{
  "url": "https://bucket.s3.amazonaws.com/data/file.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&..."
}

Errors

Documented error codes: IPV-1008, IPV-1041, AUTH-1031, DS-1070, GE-1106, DS-1022.

HTTP 400

Validation/auth failure. Codes include IPV-1008, IPV-1041, AUTH-1031, DS-1070, GE-1106, DS-1022.

TBAC file denied

{
  "Message": "AUTH-1031 - User does not have access to this file"
}

Missing filename

{
  "Message": "IPV-1008 - Missing required parameter - filename"
}

HTTP 500

Backend/generic failure.