Documents
File Download Guide
Latest Update Time: 2026-07-02 00:00:00
Use the file download API to retrieve a file's binary content by its file ID.
See the File Introduction for base URL, authentication, and required headers.
Endpoint
GET https://ppapi.qima.com/user/{userId}/file/{fileId}
Prerequisites
In addition to the required headers and authentication setup:
- Permission to access the file's underlying resource
- A
fileIdobtained from Upload File or from a report module's PDF info API
Path Parameters
| Parameter | Required | Description |
|---|---|---|
userId | Yes | QIMA client user login ID. |
fileId | Yes | The file ID to download. For inspection reports, get it from /user/{userId}/report/{productId}/pdf-info; for audit reports, from /user/{userId}/audit-report/{orderId}/pdf-info. |
Request Example
curl --location --request GET 'https://ppapi.qima.com/user/<qima-user-id>/file/<file-id>' \
--header 'Ai-Api-Access-Token: {your api access token}' \
--header 'Ai-User-Id: {your user ID}' \
--header 'Authorization: Bearer {your token}' \
--header 'Referer: https://preprodmy.qima.com/'
Successful Response
HTTP 200 OK returns the raw file content as a binary stream (not JSON) — the Content-Type response header reflects the actual file type (e.g. application/octet-stream, image/png, application/pdf).
File: application/octet-stream
Save the response body directly to disk rather than parsing it as JSON. Most HTTP clients provide a way to stream the response to a file (e.g. curl -o output.png, or writing the response stream in your language's HTTP library).
Common Errors
See common authentication errors for 401 and 403 responses.
| Status | Meaning | Recommended Action |
|---|---|---|
500 Internal Server Error | File download failed on the server (e.g. file not found, or an internal error). | Confirm the fileId is correct and still exists; contact QIMA support with the request time if the problem persists. |
Next Steps
- Use Upload File to attach new documents that you can later download with this API.
