Scan Count

[GET]  [POST] /qps/rest/3.0/count/was/wasscan

Returns the total number of scans in the user’s account. Input elements are optional and are used to filter the number of scans included in the count.

Permissions required - User must have WAS module enabled. The user account must have these permissions: Access Permission “API Access”. The count includes scans in the user's scope.

Input ParametersInput Parameters

These elements are optional and act as filters. When multiple elements are specified, parameters are combined using a logical AND.

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

id

Optional

integer

The scan ID.

name

Optional

text

The scan name.

webApp.name

Optional

text

The name of the web application being scanned.

webApp.id

Optional

integer

The ID of the web application being scanned.

webApp.tags (with operator="NONE")

Optional

integer

The tags associated with the web application being scanned.

webApp.tags.id

Optional

integer

The tag ID assigned to web application  being scanned.

reference

Optional

text

Scan Reference ID.

launchedDate

Optional

date

The date and time when the scan was launched in UTC date/time format (YYYY-MM-DDTHH:MM:SSZ).

type

Optional

keyword

The scan type: VULNERABILITY or DISCOVERY.

mode

Optional

keyword

 The mode of the scan: ONDEMAND, SCHEDULED or API.

status

Optional

keyword

The status of the scan: SUBMITTED, RUNNING, FINISHED, ERROR, CANCELED, PROCESSING.

authStatus

 Optional keyword

Indicates the status of the authentication record: NONE, NOT_USED, SUCCESSFUL, FAILED, or PARTIAL.

resultsStatus

 Optional keyword

The status of the scan: NOT_USED, TO_BE_PROCESSED, NO_HOST_ALIVE, NO_WEB_SERVICE, SERVICE_ERROR, TIME_LIMIT_REACHED, SCAN_INTERNAL_ERROR, SCAN_RESULTS_INVALID, SUCCESSFUL, PROCESSING, TIME_LIMIT_EXCEEDED, SCAN_NOT_LAUNCHED, SCANNER_NOT_AVAILABLE, SUBMITTED, RUNNING, FINISHED, CANCELED, CANCELING, ERROR, DELETED, CANCELED_WITH_RESULTS.

Sample - Get a count of scans in the user's accountSample - Get a count of scans in the user's account

Return a count of all scans in the user’s account.

API request

curl -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/3.0/count/was/wasscan"

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>534</count>
</ServiceResponse>  

Sample - Get a count of scans with certain criteriaSample - Get a count of scans with certain criteria

Return a count of scans that match all the criteria defined in the request POST data: 1) the scan name contains the word “Schedule”, 2) scan type is “VULNERABILITY”, 3) the scanned web application contains the word “Merchant”, and 4) the scan status is equal to “FINISHED”.

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/3.0/count/was/wasscan" < file.xml
Note: “file.xml” contains the request POST data.         
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="name" operator="CONTAINS">Schedule</Criteria>
        <Criteria field="type" operator="EQUALS">VULNERABILITY</Criteria
        <Criteria field="webApp.name" operator="CONTAINS">Merchant</Criteria>
        <Criteria field="status" operator="EQUALS">FINISHED</Criteria>
    </filters>
</ServiceRequest>       
    
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://qualysapi.qualys.com/qps/xsd/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
</ServiceResponse>          
    

Sample - Get the count of scans of web applications without tagsSample - Get the count of scans of web applications without tags

Return a count of scans of web applications that do not have any tags assigned.

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/3.0/count/was/wasscan" < file.xml
Note: “file.xml” contains the request POST data.         
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="webApp.tags" operator="NONE"></Criteria>
    </filters>
</ServiceRequest>        
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
</ServiceResponse>      
    

Sample - Get the count of scans of web applications with few tagsSample - Get the count of scans of web applications with few tags

Return a count of scans of web applications that have certain tags assigned.

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/3.0/count/was/wasscan" < file.xml
Note: “file.xml” contains the request POST data.        
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="webApp.tags.id" operator="EQUALS">1516928</Criteria>
        <Criteria field="webApp.tags.id" operator="EQUALS">1234567</Criteria>
    </filters>
</ServiceRequest>        
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://qualysapi.qualys.com/qps/xsd/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>15</count>
</ServiceResponse>
      
    

XSD

<platform API server>/qps/xsd/3.0/was/wasscan.xsd