Skip to main content

CLOUD SOLUTIONS

getDownloadLinks

This method returns an Object with information regarding the report availability for download and the corresponding download links.

The instant report is created one time only and available for download for less than 24 hours.

Scheduled reports are generated periodically and all report instances are saved in the GravityZone database.

Parameters

Parameter

Type

Optional

Description

reportId

String

No

The report ID

Return value

This method returns an Object containing information for downloading the report. The returned object contains:

  • readyForDownload - boolean, True if the report is ready to be downloaded or False otherwise

  • lastInstanceUrl - string, The URL for downloading the last instance of an instant or scheduled report. It will be present in the response only if readyForDownload is True. The downloaded result is an archive with two files: a CSV and a PDF. Both files refer to the same last instance of the report.

    Note

    To access this URL, the HTTP basic authentication header (username:password pair) needs to be sent, where the username it is your API key and the password is a an empty string. For more information, refer to the Authentication section for details.

  • allInstancesUrl - string, The URL downloads an archive with all generated instances of the scheduled report. The field will be present in the response only if readyForDownload is True and the report is a scheduled one. The downloaded result is an archive with a pair of files for each instance of the report: a CSV and a PDF file. Both files refer to the same instance of the report.

    Note

    To access this URL, the HTTP basic authentication header (username:password pair) needs to be sent, where the username it is your API key and the password is a an empty string. For more information, refer to the Authentication section for details.

Example

Request:

  {
       "params": {
           "reportId": "5638d7f8b1a43d49137b23c9"
       },
       "jsonrpc": "2.0",
       "method": "getDownloadLinks",
       "id": "787b5e36-89a8-4353-88b9-6b7a32e9c87g"
  }  

Response:

  {
      "id": "787b5e36-89a8-4353-88b9-6b7a32e9c87f",
      "jsonrpc":"2.0",
      "result": {
          "readyForDownload": True,
          "allInstancesUrl":"https://gravityzone.bitdefender.com/api/v1.0/http/downloadReportZip?reportId=5645cba6f12a9a8c5e8b4748&allInstances=1&serviceType=1",
          "lastInstanceUrl":"https://gravityzone.bitdefender.com/api/v1.0/http/downloadReportZip?reportId=5645cba6f12a9a8c5e8b4748&allInstances=0&serviceType=1"
      }
  }  

Response:

  {
      "id": "787b5e36-89a8-4353-88b9-6b7a32e9c87f",
      "jsonrpc":"2.0",
      "result": {
          "readyForDownload": False
      }
  }  

Request:

  Eg: Download the report using curl:
   curl -f0 -u "YOUR_API_KEY:"https://gravityzone.bitdefender.com/api/v1.0/http/downloadReportZip?reportId=5645cba6f12a9a8c5e8b4748&\allInstances=0&serviceType=1 > lastReportInstances.zip   

Equivalent with:   

curl -f0 -H "Authorization: Basic API_KEY_ENCODED_BASE64" https://YOUR-HOSTNAME/api/v1.0/http/downloadReportZip?reportId=5645cba6f12a9a8c5e8b4748&\allInstances=0&serviceType=1 > lastReportInstances.zip   

Where API_KEY_ENCODED_BASE64 is your API key encoded  using base64.