Download File
Download files using issued tokens. Issued tokens are single-use and expire after 30 minutes.
Required Permissions
Requires the MEMBER role or higher, and a valid download token.
HTTP Request
GET /api/sonar/downloader
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
"https://HOSTNAME/downloader?token=4ba40c97-b31b-450f-8af8-ceb1b94f5514&force_download=true"
Request Parameters
| Key | Required | Type | Description | Notes |
|---|---|---|---|---|
| token | Y | String | Download token GUID | 36-character GUID (e.g., 4ba40c97-b31b-450f-8af8-ceb1b94f5514) |
| force_download | N | Boolean | Force file download | true: direct download, false: attempt browser preview |
Success Response
HTTP status code 200 with file content
Response Headers
| Header | Description |
|---|---|
| Content-Type | MIME type based on file extension |
| Content-Disposition | attachment (direct download) or inline (browser preview) |
| Transfer-Encoding | chunked (chunked transfer encoding) |
The response body contains the binary data of the requested file.
Error Responses
Token missing or invalid
HTTP status code 403 response
{
"error_code": "token-not-found",
"error_msg": "download token not found or expired"
}
Server internal error preventing file download
HTTP status code 500 response
{
"error_code": "file-download-error",
"error_msg": "internal server error occurred during file download"
}