Documents
File Introduction
Latest Update Time: 2026-07-02 00:00:00
The File module lets you upload files and attach them to a QIMA resource (an order, inspection product, etc.), and download files by ID. It's a generic building block used across other modules — for example, use it to attach supporting documents to an order, or to download a generated PDF report once you have its file ID from a report module API.
This page documents the shared setup used by every File guide. Each API-specific guide links back here for authentication, headers, and environment details.
Base URL
All File APIs are served from the QIMA Public API host for your environment:
https://ppapi.qima.com
For production integrations, replace the host with the QIMA API host provided for your environment.
Required Headers
Call the Auth API first (POST /auth/v2/token) before any File request. See the Getting Started Guide or Get Token API for authentication setup.
| Header / Parameter | Location | Source | Description |
|---|---|---|---|
Ai-Api-Access-Token | Request header (all File APIs) | Provided by QIMA | Request source identifier. Each client may have a different value per environment. |
Ai-User-Id | Request header (all File APIs) | Auth API response userId | QIMA client user login ID of the authenticated user. |
Authorization | Request header (all File APIs) | Auth API access token | Format: Bearer <access-token>. Use the token from the same Auth API session as the other headers. |
Referer | Request header (all File APIs) | Fixed value | https://preprodmy.qima.com/ |
Common Authentication Errors
| Status | Meaning | Recommended Action |
|---|---|---|
401 Unauthorized | Token or user authentication failed. | Confirm the Authorization, Ai-User-Id, and Ai-Api-Access-Token headers are from the same Auth API session and environment. |
403 Forbidden | The user does not have access to the requested resource. | Verify account permissions for the target File operation. |
Each API guide includes additional operation-specific error codes.
Available APIs
| API | Method | Endpoint | Guide | API Reference |
|---|---|---|---|---|
| Upload file | POST | /user/{userId}/doc-type/{docType}/source/{sourceId}/file | File Upload Guide | API Reference |
| Download a file by ID | GET | /user/{userId}/file/{fileId} | File Download Guide | API Reference |
Integration Workflow
Use this flow when you want to attach a document to an existing QIMA resource, then be able to retrieve it later.
| Step | Guide |
|---|---|
| Upload a file | File Upload Guide |
| Download a file | File Download Guide |
The Report module's PDF info APIs also return a fileId you can pass straight into Download a file by ID — you don't need to have uploaded the file yourself to download it, as long as you have a valid file ID for a resource your account can access.
Choosing the Right API
| Your goal | Recommended APIs |
|---|---|
| Attach a document to an order, inspection product, or other resource | Upload File |
| Retrieve a file's binary content by ID (including generated reports) | Download a File by ID |
Related Documentation
- Getting Started Guide — Authentication and first API call
- Module Overview — Overview of all QIMA Public API modules
- API Reference — Interactive endpoint explorer for all Public APIs
