Vulnerability

This documentation is currently outdated and in the process of being updated. This documentation is provided as a temporary reference to various API endpoints and output. This warning will be at the top of each outdated page. As the documentation is updated, this warning will be removed.

Checking the Status of an Export Job

Check the status of an export job.

API Call: GET/client/{clientId}/export/{exportId}/status

URL: https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/export/<EXPORTID>/status

URL Parameters

Name Description Additional Information
PLATFORM Platform number. Endpoint URL Structure
CLIENTID Client ID number. Finding Your Client ID
EXPORTID Export Job ID number.

User Roles

The user roles that can check the status of an export job are:

  • Manager
  • Group Manager
  • User

Python

Python Sample export_status Snippet

Copy

import requests

platform = 'https://platform<PLATFORM>.risksense.com'
api_key = '<APIKEY>'
client_id = <CLIENTID>
export_id = <EXPORTID>

header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}

url = platform + "/api/v1/client/" + str(client_id) + "/export/" + str(export_id) + "/status"

response = requests.get(url, headers=header)

Replace angle bracket parameters with your own values.

Python Parameters

Name Description Type Required Additional Information
PLATFORM Platform number. integer Y Endpoint URL Structure
APIKEY Your API key. string Y Generating an API Token
CLIENTID Client ID number. integer Y Finding Your Client ID
EXPORTID Export Job ID number. integer Y

cURL

cURL Sample export_status Snippet

Copy

curl -X GET "https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/export/<EXPORTID>/status"
  -H  "accept: application/json"
  -H  "x-api-key: <APIKEY>"

Replace angle bracket parameters with your own values.

cURL Parameters

Name Description Type Required Additional Information
PLATFORM Platform number. integer Y Endpoint URL Structure
CLIENTID Client ID number. integer Y Finding Your Client ID
EXPORTID Export Job ID number. integer Y
APIKEY Your API key. string Y Generating an API Token

Response Parameters

Sample Response

Copy

{
  "id": <ID>,
  "filename": "<FILENAME>",
  "status": "<STATUS>"
}

Name Description Type Additional Information
ID Export ID number. integer
FILENAME Export file name. string
STATUS Job status. string

HTTP Status Codes

Code Description
200 Successfully fetched the export status.

200 Sample Response

Copy

{
  "id": 3,
  "filename": "host.csv",
  "status": "COMPLETE"
}

Code Description
400 Bad Request
401 Unauthorized
404 Unable to find the export ID

Downloading a File Created by an Export Job

Download a file created by an export job.

API Call: GET/client/{clientId}/export/{exportId}

URL: https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/export/<EXPORTID>

URL Parameters

Name Description Additional Information
PLATFORM Platform number. Endpoint URL Structure
CLIENTID Client ID number. Finding Your Client ID
EXPORTID Export ID number.

User Roles

The user roles that can download a file created by an export job are:

  • Manager
  • Group Manager
  • User

Python

Python Sample download_exportfile Snippet

Copy

import requests

platform = 'https://platform<PLATFORM>.risksense.com'
api_key = '<APIKEY>'
client_id = <CLIENTID>
export_id = <EXPORTID>

filename = "<FILENAME>"

header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}

url = platform + "/api/v1/client/" + str(client_id) + "/export/" + str(export_id)

response = requests.get(url, headers=header)

open(filename, "wb").write(response.content)

Replace angle bracket parameters with your own values.

Python Parameters

Name Description Type Required Additional Information
PLATFORM Platform number. integer Y Endpoint URL Structure
APIKEY Your API key. string Y Generating an API Token
CLIENTID Client ID number. integer Y Finding Your Client ID
EXPORTID Export ID number. integer Y
FILENAME Export file name. string Y

cURL

cURL Sample download_exportfile Snippet

Copy

curl -X GET "https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/export/<EXPORTID>"
  -H  "accept: application/json"
  -H  "x-api-key: <APIKEY>"

Replace angle bracket parameters with your own values.

cURL Parameters

Name Description Type Required Additional Information
PLATFORM Platform number. integer Y Endpoint URL Structure
CLIENTID Client ID number. integer Y Finding Your Client ID
EXPORTID Export ID number. integer Y
APIKEY Your API key. string Y Generating an API Token

Response Parameters

Sample Response

Copy

Download file.

HTTP Status Codes

Code Description
200 Successfully fetched the export file
400 Bad Request
401 Unauthorized
404 Unable to find the export id
500 Error occurred when connecting to the file service

Delete export files.

API Call: DELETE/client/{clientId}/export/{exportId}

URL: https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/export/<EXPORTID>

URL Parameters

Name Description Additional Information
PLATFORM Platform number. Endpoint URL Structure
CLIENTID Client ID number. Finding Your Client ID
EXPORTID Export ID number.

User Roles

The user roles that can delete a file related to an export job are:

  • Manager
  • Group Manager
  • User

Python

Python Sample delete_exportfile Snippet

Copy

TBA

Replace angle bracket parameters with your own values.

Python Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
APIKEY Your API key. Generating an API Token

cURL

cURL Sample delete_exportfile Snippet

Copy

curl -X DELETE "https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/export/<EXPORTID>"
  -H  "accept: application/json"
  -H  "x-api-key: <APIKEY>"

Replace angle bracket parameters with your own values.

cURL Parameters

Name Description Additional Information
PLATFORM Platform number. integer
CLIENTID Client ID number. Finding Your Client ID
EXPORTID Export ID number. integer
APIKEY Your API key. Generating an API Token

HTTP Status Codes

Code Description
204 Delete request was processed without errors
400 Bad Request
401 Unauthorized
404 Error occurred when connecting to the file service