QIMA Logo

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 / ParameterLocationSourceDescription
Ai-Api-Access-TokenRequest header (all File APIs)Provided by QIMARequest source identifier. Each client may have a different value per environment.
Ai-User-IdRequest header (all File APIs)Auth API response userIdQIMA client user login ID of the authenticated user.
AuthorizationRequest header (all File APIs)Auth API access tokenFormat: Bearer <access-token>. Use the token from the same Auth API session as the other headers.
RefererRequest header (all File APIs)Fixed valuehttps://preprodmy.qima.com/

Common Authentication Errors

StatusMeaningRecommended Action
401 UnauthorizedToken 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 ForbiddenThe 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

APIMethodEndpointGuideAPI Reference
Upload filePOST/user/{userId}/doc-type/{docType}/source/{sourceId}/fileFile Upload GuideAPI Reference
Download a file by IDGET/user/{userId}/file/{fileId}File Download GuideAPI 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.

1. POST /auth/v2/token

2. POST /user/{userId}/doc-type/{docType}/source/{sourceId}/file
multipart/form-data, real file

Store id (file ID) from the response

3. GET /user/{userId}/file/{fileId}
Download the file later

StepGuide
Upload a fileFile Upload Guide
Download a fileFile 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 goalRecommended APIs
Attach a document to an order, inspection product, or other resourceUpload File
Retrieve a file's binary content by ID (including generated reports)Download a File by ID