Filter

Listing Saved and Shared Filters

List saved and shared filters.

API Call: GET/client/{clientId}/search/{subject}/filter

URL: https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/search/<SUBJECT>/filter

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID
SUBJECT Subject to search against.

User Roles

The user roles that can list saved and shared filters are:

  • Group Manager
  • Manager
  • User

Python

Python Sample list_sharedsavedfilters Snippet


import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
client_id = <INSERT CLIENT ID HERE>
​
subject = 'hostFinding'
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
url = platform + "/api/v1/client/" + str(client_id) + "/search/" + subject + "/filter"
​
response = requests.get(url, headers=header)

Make sure to replace the angle bracket parameters here with your own values.

Python Parameters

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

cURL

cURL Sample list_sharedsavedfilters Snippet


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

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
SUBJECT Subject to search against. Options: host, hostFinding, application, applicationFinding
APIKEY Your API key. Generating an API Token

Response Parameters

Sample Response


[
  {
    "id": <FILTERID>,
    "uuid": "<FILTERUUID>",
    "clientId": <CLIENTID>,
    "subject": "<FILTERSUBJECT>",
    "name": "<FILTERNAME>",
    "description": "<FILTERDESCRIPTION>",
    "filters": [
      {
        "field": "<FIELD>",
        "exclusive": <EXCLUSIVE>,
        "operator": "<OPERATOR>",
        "value": "<VALUE>"
      },
      {
        "field": "<FIELD>",
        "exclusive": <EXCLUSIVE>,
        "operator": "<OPERATOR>",
        "value": "<VALUE>"
      }
    ],
    "created": "<CREATED>",
    "updated": "<UPDATED>",
    "shared": <SHARED>,
    "owners": [
      <OWNER>, <OWNER>
    ],
    "system": <SYSTEM>,
    "standard": <STANDARD>,
    "dateUntilNewBadgeShown": "<DATEUNTILNEWBADGESHOWN>",
    "weight": <WEIGHT>
  }
]
Name Description Additional Information
ID Filter ID number. integer
FILTERUUID Filter UUID.
CLIENTID Client ID number. integer
FILTERSUBJECT Filter subject.
FILTERNAME Filter name.
FILTERDESCRIPTION Filter description.
FIELD Filter field. string
EXCLUSIVE Exclusive. boolean Options: True, False
OPERATOR Search operator. Depends on value.
VALUE Search value. string
CREATED Date created.
UPDATED Date updated.
SHARED Is filter shared? Options: True = Yes, False = No
OWNERS Filter owners' user ID(s).
SYSTEM Is this filter set as a system filter? boolean
STANDARD Is filter shown to all platform users? boolean
DATEUNTILNEWBADGESHOWN Future date to be set that adds up to the count shown as a badge in the front end. string($date)
WEIGHT Weight. number Range: 0-999

HTTP Status Codes

Code Description
200 Success

200 Sample Response

[
  {
    "description": "string",
    "filters": [
      {
        "field": "string",
        "exclusive": true,
        "operator": "EXACT",
        "value": "string"
      }
    ],
    "id": 0,
    "name": "string",
    "shared": true,
    "standard": true,
    "system": true,
    "dateUntilNewBadgeShown": "string",
    "weight": 0
  }
]

Creating a New Saved Filter

Create a new saved filter.

API Call: POST/client/{clientId}/search/{subject}/filter

URL: https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/search/<SUBJECT>/filter

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID
SUBJECT Subject to search against.

User Roles

The user roles that can create a saved filter are:

  • Group Manager
  • Manager
  • User

Python

Python Sample create_saved Snippet


import json
import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
client_id = <INSERT CLIENT ID HERE>
​
subject = 'hostFinding'
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
body = {
    "description": "Filter for IDs 1, 2, 3, or 4.",
    "filters": [
        {
            "field": "id",
            "exclusive": True,
            "operator": "IN",
            "value": "1,2,3,4"
        }
    ],
    "name": "My Saved Filter",
    "shared": True,
    "standard": True
}
​
url = platform + "/api/v1/client/" + str(client_id) + "/search/" + subject + "/filter"
​
response = requests.post(url, headers=header, data=json.dumps(body))

Make sure to replace the angle bracket parameters here 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 create_saved Snippet


curl -X POST "https://platform<PLATFORM>.risksense.com/api/v1/client/<CLIENTID>/search/<SUBJECT>/filter"
  -H  "accept: application/json"
  -H  "x-api-key: <APIKEY>"
  -H  "Content-Type: application/json"
  -d "{  \"description\": \"<DESCRIPTION>\",  \"filters\": [    {      \"field\": \"<FIELD>\",      \"exclusive\": <EXCLUSIVE>,      \"operator\": \"<OPERATOR>\",      \"value\": \"<VALUE>\"    }  ],  \"name\": \"<FILTERNAME>\",  \"shared\": <SHARED>,  \"standard\": <STANDARD>}"

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
SUBJECT Filter subject.
APIKEY Your designated API key. Generating an API Token
DESCRIPTION Filter description.
FIELD Filter field. string
EXCLUSIVE Exclusive. boolean Options: True, False
OPERATOR Search operator. Depends on value.
VALUE Search value. string
FILTERNAME Filter name.
SHARED Is filter shared? Options: True = Yes, False = No
STANDARD Is filter shown to all platform users? boolean

Response Parameters

Sample Response


{
  "description": "<DESCRIPTION>",
  "filters": [
    {
      "field": "<FIELD>",
      "exclusive": <EXCLUSIVE>,
      "operator": "<OPERATOR>",
      "value": "<VALUE>"
    }
  ],
  "id": <ID>,
  "name": "<FILTERNAME>",
  "shared": <SHARED>,
  "standard": <STANDARD>,
  "system": <SYSTEM>,
  "dateUntilNewBadgeShown": "<DATEUNTILNEWBADGESHOWN>",
  "weight": <WEIGHT>
}

Name Description Additional Information
DESCRIPTION Filter description.
FIELD Filter field. string
EXCLUSIVE Exclusive. boolean Options: True, False
OPERATOR Search operator. Depends on value.
VALUE Search value. string
FILTERNAME Filter name.
SHARED Is filter shared? Options: True = Yes, False = No
STANDARD Is filter shown to all platform users? boolean
SYSTEM Is this filter set as a system filter? boolean
DATEUNTILNEWBADGESHOWN Future date to be set that adds up to the count shown as a badge in the front end. string($date)
WEIGHT Weight. number Range: 0-999

HTTP Status Codes

Code Description
200 Created

200 Sample Response

{
  "description": "string",
  "filters": [
    {
      "field": "string",
      "exclusive": true,
      "operator": "EXACT",
      "value": "string"
    }
  ],
  "id": 0,
  "name": "string",
  "shared": true,
  "standard": true,
  "system": true,
  "dateUntilNewBadgeShown": "string",
  "weight": 0
}
Code Description
401 Unauthorized

Retrieving a Specific Filter

Short description

API Call: GET/client/{clientId}/search/{subject}/filter/{filterId}

URL: ``

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID

User Roles

The user roles that can _____ are:

  • Group Manager
  • Manager

Python

Python Sample file_details Snippet


import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
client_id = <INSERT CLIENT ID HERE>
​
subject = 'hostFinding'
filter_id = <INSERT FILTER ID HERE>
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
url = platform + "/api/v1/client/" + str(client_id) + "/search/" + subject + "/filter/" + str(filter_id)
​
response = requests.get(url, headers=header)

Make sure to replace the angle bracket parameters here with your own values.

Python Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
APIKEY Your designated API key. Generating an API Token
ASSESSMENTNAME Name of assessment to create.
STARTDATE Assessment start date. Format YYYY-MM-DD.
NOTES Notes about the assessment. Optional

cURL

cURL Sample sample_file Snippet

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

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

Response Parameters

Sample Response

Name Description Type
ID Assessment ID number. integer
NAME Name of assessment. string
STARTDATE Assessment start date. Format YYYY-MM-DD. string($date)
NOTES Assessment notes. string
CLIENTID Client ID number. integer

HTTP Status Codes

Code Description
201 Success

201 Sample Response

{
  "id": 12,
  "name": "Q2",
  "startDate": "2018-04-01",
  "notes": "",
  "clientId": 5
}
Code Description
400 User Error

400 Sample Response

{
  "status": 0,
  "path": "string",
  "errors": [
    {
      "field": "string",
      "code": "string"
    }
  ]
}
Code Description
401 Unauthorized
404 Not Found

Updating a Specific Filter

Short description

API Call: PUT/client/{clientId}/search/{subject}/filter/{filterId}

URL: ``

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID

User Roles

The user roles that can ______________________ are:

  • Group Manager
  • Manager

Python

Python Sample file_details Snippet


import json
import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
client_id = <INSERT CLIENT ID HERE>
​
subject = 'hostFinding'
filter_id = <INSERT FILTER ID HERE>
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
body = {
    "description": "Filter for IDs 1, 2, 3, 4, or 5.",
    "filters": [
        {
            "field": "id",
            "exclusive": True,
            "operator": "IN",
            "value": "1,2,3,4,5"
        }
    ],
    "name": "My Saved Filter",
    "shared": True,
    "standard": True
}
​
url = platform + "/api/v1/client/" + str(client_id) + "/search/" + subject + "/filter/" + str(filter_id)
​
response = requests.put(url, headers=header, data=json.dumps(body))

Make sure to replace the angle bracket parameters here with your own values.

Python Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
APIKEY Your designated API key. Generating an API Token
ASSESSMENTNAME Name of assessment to create.
STARTDATE Assessment start date. Format YYYY-MM-DD.
NOTES Notes about the assessment. Optional

cURL

cURL Sample sample_file Snippet

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

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

Response Parameters

Sample Response

Name Description Type
ID Assessment ID number. integer
NAME Name of assessment. string
STARTDATE Assessment start date. Format YYYY-MM-DD. string($date)
NOTES Assessment notes. string
CLIENTID Client ID number. integer

HTTP Status Codes

Code Description
201 Success

201 Sample Response

{
  "id": 12,
  "name": "Q2",
  "startDate": "2018-04-01",
  "notes": "",
  "clientId": 5
}
Code Description
400 User Error

400 Sample Response

{
  "status": 0,
  "path": "string",
  "errors": [
    {
      "field": "string",
      "code": "string"
    }
  ]
}
Code Description
401 Unauthorized
404 Not Found

Deleting a Specific Filter

Short description

API Call: DELETE/client/{clientId}/search/{subject}/filter/{filterId}

URL: ``

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID

User Roles

The user roles that can _______________ are:

  • Group Manager
  • Manager

Python

Python Sample file_details Snippet


import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
client_id = <INSERT CLIENT ID HERE>
​
subject = 'hostFinding'
filter_id = <INSERT FILTER ID HERE>
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
url = platform + "/api/v1/client/" + str(client_id) + "/search/" + subject + "/filter/" + str(filter_id)
​
response = requests.delete(url, headers=header)

Make sure to replace the angle bracket parameters here with your own values.

Python Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
APIKEY Your designated API key. Generating an API Token
ASSESSMENTNAME Name of assessment to create.
STARTDATE Assessment start date. Format YYYY-MM-DD.
NOTES Notes about the assessment. Optional

cURL

cURL Sample sample_file Snippet

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

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

Response Parameters

Sample Response

Name Description Type
ID Assessment ID number. integer
NAME Name of assessment. string
STARTDATE Assessment start date. Format YYYY-MM-DD. string($date)
NOTES Assessment notes. string
CLIENTID Client ID number. integer

HTTP Status Codes

Code Description
201 Success

201 Sample Response

{
  "id": 12,
  "name": "Q2",
  "startDate": "2018-04-01",
  "notes": "",
  "clientId": 5
}
Code Description
400 User Error

400 Sample Response

{
  "status": 0,
  "path": "string",
  "errors": [
    {
      "field": "string",
      "code": "string"
    }
  ]
}
Code Description
401 Unauthorized
404 Not Found

Listing System Filters

Short description

API Call: ``

URL: ``

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID

User Roles

The user roles that can _______________________ are:

  • Group Manager
  • Manager

Python

Python Sample file_details Snippet


import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
​
subject = 'hostFinding'
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
url = platform + "/api/v1/search/" + subject + "/filter"
​
response = requests.get(url, headers=header)

Make sure to replace the angle bracket parameters here with your own values.

Python Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
APIKEY Your designated API key. Generating an API Token
ASSESSMENTNAME Name of assessment to create.
STARTDATE Assessment start date. Format YYYY-MM-DD.
NOTES Notes about the assessment. Optional

cURL

cURL Sample sample_file Snippet

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

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

Response Parameters

Sample Response

Name Description Type
ID Assessment ID number. integer
NAME Name of assessment. string
STARTDATE Assessment start date. Format YYYY-MM-DD. string($date)
NOTES Assessment notes. string
CLIENTID Client ID number. integer

HTTP Status Codes

Code Description
201 Success

201 Sample Response

{
  "id": 12,
  "name": "Q2",
  "startDate": "2018-04-01",
  "notes": "",
  "clientId": 5
}
Code Description
400 User Error

400 Sample Response

{
  "status": 0,
  "path": "string",
  "errors": [
    {
      "field": "string",
      "code": "string"
    }
  ]
}
Code Description
401 Unauthorized
404 Not Found

Retrieving a Specific System Filter

Retrieve a specific system filter.

API Call: GET/search/{subject}/filter/{filterId}

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

URL Parameters

Name Description Additional Information
PLATFORM Platform number. If you are on platform 1, you do not need to put a number.
CLIENTID Client ID number. Finding Your Client ID

User Roles

The user roles that can _______________________ are:

  • Group Manager
  • Manager

Python

Python Sample file_details Snippet


import requests
​
platform = 'https://platform.risksense.com'
api_key = '<INSERT API KEY HERE>'
​
subject = 'hostFinding'
filter_id = <INSERT FILTER ID HERE>
​
header = {
    "x-api-key": api_key,
    "content-type": "application/json"
}
​
url = platform + "/api/v1/search/" + subject + "/filter/" + str(filter_id)
​
response = requests.get(url, headers=header)

Make sure to replace the angle bracket parameters here with your own values.

Python Parameters

Name Description Additional Information
PLATFORM Platform number.
CLIENTID Client ID number. Finding Your Client ID
APIKEY Your designated API key. Generating an API Token
ASSESSMENTNAME Name of assessment to create.
STARTDATE Assessment start date. Format YYYY-MM-DD.
NOTES Notes about the assessment. Optional

cURL

cURL Sample sample_file Snippet

Make sure to replace the angle bracket parameters here with your own values.

cURL Parameters

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

Response Parameters

Sample Response

Name Description Type
ID Assessment ID number. integer
NAME Name of assessment. string
STARTDATE Assessment start date. Format YYYY-MM-DD. string($date)
NOTES Assessment notes. string
CLIENTID Client ID number. integer

HTTP Status Codes

Code Description
201 Success

201 Sample Response

{
  "id": 12,
  "name": "Q2",
  "startDate": "2018-04-01",
  "notes": "",
  "clientId": 5
}
Code Description
400 User Error

400 Sample Response

{
  "status": 0,
  "path": "string",
  "errors": [
    {
      "field": "string",
      "code": "string"
    }
  ]
}
Code Description
401 Unauthorized
404 Not Found