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
KeyRequiredTypeDescriptionNotes
tokenYStringDownload token GUID36-character GUID (e.g., 4ba40c97-b31b-450f-8af8-ceb1b94f5514)
force_downloadNBooleanForce file downloadtrue: direct download, false: attempt browser preview

Success Response

HTTP status code 200 with file content

Response Headers
HeaderDescription
Content-TypeMIME type based on file extension
Content-Dispositionattachment (direct download) or inline (browser preview)
Transfer-Encodingchunked (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"
}