Fetch List of Scripts from Library API

This API lets you fetch the list of scripts from script library.

POSTsm/v1/script-library/search

Input ParametersInput Parameters

Parameter Mandatory/Optional Data Type Description
filter
Optional String Filter the API results based on module code, script meta data and QID custom script meta data.
includeScriptContent
Optional String Use to include the script content in list result.

SampleSample

API Request

 curl -X POST 'https://<qualys_base_url> /sm/v1/scriptlibrary/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <authToken>' \
--data '{"filter":"moduleCode:CAR ","includeScriptContent":true}'

Response

[
 {
 "body": {
 "totalCount": 1,
"list": 
 [
 
{
 "severity": 0,
 "scriptContent":
 
"IyEvYmluL3NoCiMgVGhpcyBpcyBiYXNoIHByb2dyYW0gdG8gZGlzcGxheSBIZ
 
WxsbyBXb3JZAplY2hvICIgSGVsbG8gV29ybGQgaW4gc2NyaXB0IDMiCg==",
 "customScriptMetadata": null,
 "moduleCode": "AUTOR",
 "scriptLanguage":
 {
 "name": "Shell",
 "id": 6
 },
 "created":
 {
 "dateTime": 1681122311775,
 "user": null
},
 "description": null,
 "threshold": 0,
 "title": "script4.sh",
 "type": 
{
 "name": "Custom Script",
 "id": 1
},
 "platform": "LINUX",
 "autorScriptsMetadata":
 {
 "tech":
 [
 "Windows 10",
 "CentOS 7.x"
],
 "name": "script4.sh",
 "policies": 
[
 "cis redhat 8 linux enterprise v3.1.0"
],
 "benchmarkType": "CIS",
"cid": "7988"
},
.
.
.
 
LS0tLS0tLS0tLS0tIEVPUyBDSUQgMTA1MiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS
MK",
 "customScriptMetadata": null,
 "moduleCode": "AUTOR",
 "scriptLanguage": 
{
 "name": "PowerShell-Script",
 "id": 4
},
 "created":
 {
 "dateTime": 1681736085425,
 "user": null
},
 "description": null,
 "threshold": 0,
 "title": "1052.ps1",
 "type": 
{
 "name": "Custom Script",
 "id": 1
},
 "platform": "WINDOWS",
 "autorScriptsMetadata": {
 "tech": [
 "Red Hat Linux 7.0",
 "Windows 10"
],
 "name": "1052.ps1",
 "policies": 
[
 "CIS Benchmark for Microsoft Windows 10 Enterprise
 RTM (Release 1511), v1.1.0 [Scored, Level 1+ BitLocker and Level 
2+
 BitLocker] v.2.0"
],
 "benchmarkType": "CIS",
 "cid": "7337"
},
"versions": [
{
 "path": "AUTOR/Remediation/Custom
 Script/Windows/PowerShell-Script/v1/CIS/1052.ps1",
 "version": "v1",
 "sha": "d697ad836009ea29f86abf01d0bf1573e2ad563b"
}
],
 "vmdrScriptMetadata": null,
 "id": "1039",
 "lastUpdatedDateTime": 1681736085425,
 "category": {
 "name": "Remediation",
 "id": 7
},
"disclaimer": null,
"status": null
 }
]
}
}

To know the details of the response codes, refer to Appendix.