Results and downloads
List artifacts
Section titled “List artifacts”GET /api/v1/artifacts?job_id={job_id}GET /api/v1/artifacts/{artifact_id}Artifacts are visible only to the owning account. Read the list after the job completes.
Direct download
Section titled “Direct download”GET /api/v1/artifacts/{artifact_id}/downloadcurl --fail-with-body -OJ \ https://omnidoc.top/api/v1/artifacts/6n2b7z5q8v4m1c3k/download \ -H "X-API-Key: $OMNIDOC_API_KEY"Downloads support ETag and conditional requests. Stream large files to disk instead of reading them into memory at once.
Download strategy
Section titled “Download strategy”GET /api/v1/artifacts/{artifact_id}/download-linkReturns:
{ "mode": "direct", "url": "https://download.example/...", "filename": "report.en.docx"}Clients must also handle url being null; then use the direct download endpoint. Fetch a new short-lived URL after one expires.
Preview
Section titled “Preview”GET /api/v1/artifacts/{artifact_id}/preview-urlHTML, SVG and XML results are always downloaded as attachments.
File names
Section titled “File names”Parse the RFC 5987 filename* first, then fall back to filename. Whichever you use, keep only the basename, and truncate or replace illegal characters according to your local file system.
A job may return several artifacts or one packaged result. Go by the format in the artifact list and the download response headers; do not guess the response type from the source file’s extension.