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/script-library/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <authToken>' \
--data '{"filter":"moduleCode:CAR ","includeScriptContent":true}'

Response

{
    "body": {
        "totalCount": 1,
        "list": [
            {
                "scriptLanguage": {
                    "name": "PowerShell-Script",
                    "id": 4
                },
                "scriptContent": "IyEvYmluL3NoCiMgVGhpcyBpcyBiYXNoIHByb2dyYW0gdG8gZGlzcGxheSBIZWxsbyBXb3JZAplY2hvICIgSGVsbG8gV29ybGQgaW4gc2NyaXB0IDMiCg==",
                "lastCommittedDatetime": 1764248892000,
                "displayName": "Adjust Event Log Size.ps1",
                "description": "If the event log size is insufficient, overwrites may occur before relevant data exported from the Windows Event Log. To prevent overwrites, you can increase the maximum size of these event logs.The script will set a custom log size for the events logs.",
                "threshold": 0,
                "title": "Adjust Event Log Size.ps1",
                "type": {
                    "name": "Custom Script",
                    "id": 1
                },
                "patchScriptsMetadata": null,
                "platform": "WINDOWS",
                "categoryDescription": "Contains scripts to manage Windows Event Viewer Log on the host.",
                "mode": "Standard",
                "autorScriptsMetadata": null,
                "vmdrScriptMetadata": null,
                "customScriptsMetadata": {
                    "severity": "3",
                    "qids": null,
                    "hasParameters": false,
                    "softwarePackageMetadata": null,
                    "name": "Adjust Event Log Size.ps1",
                    "description": "If the event log size is insufficient, overwrites may occur before relevant data exported from the Windows Event Log. To prevent overwrites, you can increase the maximum size of these event logs.The script will set a custom log size for the events logs.",
                    "subType": "Response",
                    "threshold": "500",
                    "params": null,
                    "thresholdTimeUnit": "SECOND",
                    "disclaimer": "THIS SCRIPT IS PROVIDED TO YOU \"AS IS.\" TO THE EXTENT PERMITTED BY LAW, QUALYS HEREBY DISCLAIMS ALL WARRANTIES AND LIABILITY FOR THE PROVISION OR USE OF THIS SCRIPT. IN NO EVENT SHALL THESE SCRIPTS BE DEEMED TO BE CLOUD SERVICES AS PROVIDED BY QUALYS",
                    "qidCveMapping": null
                },
                "id": "278042",
                "disclaimer": "THIS SCRIPT IS PROVIDED TO YOU \"AS IS.\" TO THE EXTENT PERMITTED BY LAW, QUALYS HEREBY DISCLAIMS ALL WARRANTIES AND LIABILITY FOR THE PROVISION OR USE OF THIS SCRIPT. IN NO EVENT SHALL THESE SCRIPTS BE DEEMED TO BE CLOUD SERVICES AS PROVIDED BY QUALYS",
                "severity": 0,
                "ispmScriptsMetadata": null,
                "moduleCode": "CAR",
                "created": {
                    "dateTime": 1774509849741,
                    "user": null
                },
                "iconClass": "qx qx-remediation",
                "scriptLibraryId": 219348637,
                "versions": [
                    {
                        "fullPath": "CAR/Windows Event Viewer/Custom Script/Windows/PowerShell-Script/1/Adjust Event Log Size/Adjust Event Log Size.ps1",
                        "path": "CAR/Windows Event Viewer/Custom Script/Windows/PowerShell-Script/1/Adjust Event Log Size/Adjust Event Log Size.ps1",
                        "version": "1",
                        "sha": "d81723c780a0c862f917eddf583b0276652e1df0"
                    }
                ],
                "customQidMetadata": null,
                "systemCategory": false,
                "lastUpdatedDateTime": 1774509849741,
                "category": {
                    "name": "Windows Event Viewer",
                    "id": 0
                },
                "status": null,
                "isEnable": true,
                "scriptContent": ""
            }
        ]
    }
}

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