curl --request POST \
--url https://api-test.paiera.ai/v1/file/download \
--header 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
--header 'Content-Type: application/json' \
--data '{
"fileId": "EXAMPLE_FILE_ID",
"fileName": "statement_USD_20261101000000-20261102235959.xlsx"
}' \
--output 'statement_USD_20261101000000-20261102235959.xlsx'
File
Download File
Download a file as a binary stream using its file ID and filename.
curl --request POST \
--url https://api-test.paiera.ai/v1/file/download \
--header 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
--header 'Content-Type: application/json' \
--data '{
"fileId": "EXAMPLE_FILE_ID",
"fileName": "statement_USD_20261101000000-20261102235959.xlsx"
}' \
--output 'statement_USD_20261101000000-20261102235959.xlsx'
Send a JSON request to download a file. A successful response contains the file binary stream, not JSON or Base64. Save the response body directly to a file.
For generated reports, query the report until generation succeeds and file information is available. Map the returned
Field requiredness and length limits are pending confirmation (待确认).
Example response headers:
The binary file content follows the headers.
file_id to fileId and file_name to fileName in the download request. Download request fields use camelCase.
Body Parameters
Send the request withContent-Type: application/json.
string
File identifier. For a report, use the returned
file_id.string
Filename. For a report, use the returned
file_name.Successful Response
The response body is the raw file content. It does not use the standard JSON response envelope and does not containcode, success, or data. Do not parse a successful download as JSON or decode it as Base64.
| Header | Value / meaning |
|---|---|
Content-Type | application/octet-stream |
Content-Disposition | attachment; filename="example.pdf"; the filename identifies the downloaded attachment. |
Content-Length | File size in bytes. |
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="statement_USD_20261101000000-20261102235959.xlsx"
Content-Length: <FILE_SIZE_IN_BYTES>
Authentication and Errors
See Authentication for the shared API authentication model. Download-specific authentication and resource permissions, failure response format, and error codes are pending confirmation (待确认).curl --request POST \
--url https://api-test.paiera.ai/v1/file/download \
--header 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
--header 'Content-Type: application/json' \
--data '{
"fileId": "EXAMPLE_FILE_ID",
"fileName": "statement_USD_20261101000000-20261102235959.xlsx"
}' \
--output 'statement_USD_20261101000000-20261102235959.xlsx'
This example uses the shared HTTP Basic authentication convention and saves the response body to the specified local file. Confirm the response status and headers before treating the saved body as a successful download.
