Get List of External Sites API
Use this API to get a list of external sites associated with your account. You can use various filters to search for the required result. The response contains details of the external sites, such as ID creation date, scan date, and scan status.
While creating your query, ensure the following:
- Value field can not be empty when the comparison operator is other than IS_EMPTY and IS_NOT_EMPTY.
- IN operator only accepts up to 1000 comma separated values.
- CONTAINS operator does not work with field of type Date, Boolean and IP Address.
- GREATER, LESSER, GREATER_THAN_EQUAL and LESS_THAN_EQUAL operators do not work with Boolean, string, and IP addresses.
Input ParametersInput Parameters
|
Parameter |
Mandatory/Optional |
Data Type |
Description |
|---|---|---|---|
|
filter |
Optional |
String |
Filter the events list by providing a value in JSON format in the request. If you do not provide filter parameter, it shows details of all the external sites. Filter parameter contains two fields, filters and operation. For example (JSON) - { "filters":[ { "field":"string", "value":"string", "operator":"CONTAINS" } ], "operation":"AND" } Refer to the list of tokens you can use to build the query: |
|
pageNumber |
Optional |
Integer |
The page to be returned. Starts from zero. |
|
pageSize |
Optional |
Integer |
Provide the number of records per page to be included in the response. Default: 10. Maximum: 200 For example, the total result set is 8000 assets. If the page size is specified as 80, then the result is divided in 100 pages with 80 assets each. |
| includes | Optional | String | Use ASSETS to include in the response. |
| Authorization | Mandatory | String | Authorization token to authenticate to the Qualys Enterprise TruRisk™ Platform. Prepend token with Bearer and one space. For example - Bearer <authToken> |
Sample 1: List all External Sites (API Request Without Filter)Sample 1: List all External Sites (API Request Without Filter)
API Request
curl -X 'POST'
'<qualys_base_url>/certview/v1/externalSites'
-H 'accept: application/json' -H Authorization: Bearer <JWT Token>
-H 'Content-Type: application/json'
-d '{
"filter": {
"filters": [
{
"field": "string",
"value": "string",
"operator": "CONTAINS"
}
],
"operation": "AND"
},
"pageNumber": 0,
"pageSize": 0,
"includes": [
"ASSETS"
]
}'
Response
[
[
{
"id":16,
"name":"8.x.x.x",
"createDate":"2022-12-05T08:41:29.000+00:00",
"scanStatus":"Canceled",
"scanDate":"2022-12-05T08:43:31.000+00:00"
},
{
"id":17,
"name":"www.example.com",
"createDate":"2022-12-05T08:41:29.000+00:00",
"scanStatus":"Error",
"scanDate":"2023-03-08T04:07:05.000+00:00"
},
{
"id":5,
"name":"www.example2.com",
"createDate":"2022-12-05T07:09:32.000+00:00",
"scanStatus":"Error",
"scanDate":"2023-03-08T04:06:13.000+00:00"
},
]
Sample 2: List all External Sites Matching the Filter Criteria Sample 2: List all External Sites Matching the Filter Criteria
API Request
curl -X 'POST'
'<qualys_base_url>/certview/v1/externalSites'
-H 'accept: application/json' -H Authorization: Bearer <JWT Token>
-H 'Content-Type: application/json'
"-d"{
"filter":{
" ""filters":[
{
"field":"externalSite.id",
"value":"14",
"operator":"EQUALS"
}" "
],
" ""operation":"AND"" "
},
"pageNumber":0,
" ""pageSize":10,
" ""includes":[
" ""ASSETS"" "
]
}
Response
[
{
"id":14,
"name":"1.xx.xx.xx",
"createDate":"2022-12-26T06:22:02.000+00:00",
"scanStatus":"Error",
"scanDate":"2023-03-16T10:42:29.000+00:00",
"assets":[
{
"id":389622,
"name":"www.examples.com",
"ip":"10.4xx.2xx.1xx"
}
]
}
Sample 3: Response When the Query Contains an Invalid OperatorSample 3: Response When the Query Contains an Invalid Operator
API Request
curl -X 'POST'
'<qualys_base_url>/certview/v1/externalSites'
-H 'accept: application/json' -H Authorization: Bearer <JWT Token>
-H 'Content-Type: application/json'
-H "Authorization: Bearer <JWT Token>"
-d {
"filter":{
"filters":[
{
"field":"external2Site.createDate",
"value":"2023-05-01",
"operator":"GREATER"
}
],
"operation":"AND"
},
"pageNumber":0,
"pageSize":10
}
Response
{
"errorCode":10001,
"message":"The Filter field :external2Site.createDate provided in
request in not allowed . Allowed fields are : [externalSite.name,
externalSite.id, externalSite.scanStatus, externalSite.scanDate,
externalSite.createDate]",
"subErrors":null,
"status":"BAD_REQUEST",
"timestamp":"2023-08-11T08:39:06.897+00:00"
}