QIMA Logo

File Upload Guide

Latest Update Time: 2026-07-02 00:00:00

Use the file upload API to upload a file and attach it to a QIMA resource (an order, inspection product, etc.).

See the File Introduction for base URL, authentication, and required headers.

Endpoint

POST https://ppapi.qima.com/user/{userId}/doc-type/{docType}/source/{sourceId}/file

This API requires Content-Type: multipart/form-data (set automatically by curl when using --form).

Prerequisites

In addition to the required headers and authentication setup:

  • Permission to upload files for the target resource
  • The sourceId of the resource you're attaching the file to (e.g. an order ID or product ID)
  • A valid docType value for what you're uploading (e.g. ORDER_ATT for an order attachment)

Path Parameters

ParameterRequiredDescription
userIdYesQIMA client user login ID.
docTypeYesThe document type of this attachment, for example ORDER_ATT (order attachment).
sourceIdYesThe resource ID this file will be linked to (e.g. inspection product ID, order ID). Use a comma to link one file to multiple resources, e.g. id_1,id_2,id_3.

Query Parameters

ParameterRequiredDescription
recordHistoryNoWhether to record this upload in the resource's history log. yes or no.
includeThumbnailNoWhether to generate/include a thumbnail for the uploaded file. yes or no.

Form Data

FieldRequiredDescription
fileYesThe file to upload.

Request Example

curl --location --request POST 'https://ppapi.qima.com/user/<qima-user-id>/doc-type/ORDER_ATT/source/<source-id>/file?recordHistory=yes&includeThumbnail=no' \
  --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/' \
  --form 'file=@"/path/to/cover-101.png"'

Successful Response

HTTP 200 OK returns the uploaded file's metadata.

{
    "id": "355FBF0CF83D4B39AA6EDE2A2A6117F4",
    "srcId": "613021F253D44D3DAC5A605DE6DB763E",
    "fileType": "ORDER_ATT",
    "fileName": "cover-101.png",
    "comments": "",
    "objectKey": "613021F253D44D3DAC5A605DE6DB763E/ORDER_ATT/0A1E336B57A744369B7BFE7D4E0222F2/cover-101.png",
    "fileSize": 109471,
    "version": 0,
    "s3Url": null,
    "createDate": "02-Jul-2026",
    "updateDate": "02-Jul-2026"
}

Response Field Notes

FieldNotes
idThe file ID. Store this — pass it to Download a File by ID to retrieve the file later.
srcIdThe resource ID the file is linked to. Matches the sourceId you passed in the path.
fileTypeThe document type. Matches the docType you passed in the path.
objectKeyInternal storage path on S3. Not needed for downloading — use id with the Download API instead.
s3UrlTemporary direct S3 URL for the file. null in this response; not populated on upload.
createDate / updateDateDate the file record was created/last updated, in dd-MMM-yyyy format (e.g. "02-Jul-2026").

Common Errors

See common authentication errors for 401 and 403 responses.

StatusMeaningRecommended Action
400 Bad RequestsourceId can't be blank.Confirm the sourceId path segment is populated.
500 Internal Server ErrorFile upload failed on the server.Contact QIMA support with the request time and file details.

Next Steps

  • Store the returned id to download the file later, or pass it to other APIs that reference uploaded attachments.