File Download API
Token-based REST API for downloading files that Sonar generates and manages, such as query results, reports, and list exports. A token is single-use and expires 30 minutes after it is issued.
Usage flow
- Call the API that generates the data you want to download. That call issues a single-use download token.
- Download the file from the Download File endpoint with the issued token.
APIs that issue a token
The following operations issue a download token before you call the Download File endpoint.
- Investigation - Download query results: Create Query Result Download Token, then download the file
- Investigation - Download a report PDF: Build Report, then obtain the token from Get Report Job and download the file
- CSV export on each list screen
Permissions
Only the account that issued a download token can use it. The permission required to issue a token follows the requirement of each domain API.