Overview
REST endpoints for downloading exported files or resolving their exported URLs.
This component documents backend export download endpoints. It is not part of the viewer postMessage contract.
Use these routes after export registration is already complete and your application has a `sourceFileUrl` or a list of source file URLs.
- Single file: `POST /viewer/exports/download`
- Batch zip: `POST /viewer/exports/download-batch`
- Default mode: backend returns the actual file or zip stream
- URL mode: add `?responseType=urls` to get JSON instead of a binary response
- Base URL example: `https://db-backend-domain/api`
Protected export download routes require a client API key before single or batch download requests can be integrated successfully.
Complete API Key Management setup first if your implementation does not yet have a client key or a defined `x-api-key` provisioning flow.
- Implementation prerequisite: review API Key Management Overview before wiring protected export routes.
- Admin route reference: use API Key Management REST API for key issuance, rotation, and lifecycle actions.
Choose the route based on whether the user needs one export or many.
- Use single download when the user wants one exported file or one exported URL.
- Use batch download when the user wants one zip for many exports or one JSON response containing many exported URLs.
- Use `sourceFileUrl` when your app tracks original file URLs for export lookup.
The client has to switch response handling based on the selected response mode.
- Blob responses: call `response.blob()`, not `response.json()`.
- URL responses: use `response.json()` only when `responseType=urls` is present.
- Filename priority: use the backend `Content-Disposition` filename first.
- Batch fallback name: use `canvas-exports.zip` only when the header is missing.
