Count Number of Scripts API

This API lets you fetch the count of scripts created in your subscription.

GETsm/v1/script/count

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

query

Optional

string

Search for scripts based on the values as follows:

-HasSystemBehaviorAffectingCommands [Boolean]: Get scripts that contain commands that can potentially impact the system behavior or performance of your assets. For example: hasSystemBehaviorAffectingCommands:"True"

- importedScriptFromGitHub [Boolean]: Get scripts that are imported from a private or public GitHub repository. For example: importedScriptFromGitHub:"True"

- gitHubAutoSync [Boolean]: Get scripts that are configured to be automatically synced with GitHub repository. For example: gitHubAutoSync:"True"

- githubSyncStatus [String]: Get scripts based on the pass or fail status of the GitHub sync. For example: gitHubSyncStatus:"failed"

- importedFromGitHubPublicRepo [Boolean]: Get scripts that are imported from a public GitHub repository. For example: importedFromGitHubPublicRepo: "true"

startAt/endAt

Optional

string

Search for scripts by specifying the start/end date and time.

groupBy

Optional

string

Group scripts by status, asset.operatingSystem, script.name, script.type, and script.category parameters.

Sample: Get the Total Count of Scripts on Linux PlatformSample: Get the Total Count of Scripts on Linux Platform

API Request

 curl -X GET
'<qualys_base_url>/sm/v1/script/count?query=platform
:LINUX' \
--header 'Authorization: <Bearer Token>

 Response

 {
    "data": {
        "count": 671
    },
    "timestamp": "2023-01-16T04:40:05.284Z"
}

Sample: Get the Total Count of Scripts by Specifying ‘groupBy’ = Severity, with startAt and endAt ValuesSample: Get the Total Count of Scripts by Specifying ‘groupBy’ = Severity, with startAt and endAt Values

API Request

curl -X GET
https://
<qualys_base_url>/sm/v1/script/count?groupBy=severity&startAt=2022-11-01T00:00:01.000Z&endAt=2023-01-08T23:59:59.000Z --header'Authorization: <Bearer Token>'

 Response

 {
    "data": {
        "3": 45,
        "1": 27,
        "5": 11,
        "2": 10,
        "4": 3
    },
    "timestamp": "2023-01-16T04:35:45.915Z"
}