Fetch Script Details Based on Script ID or Name API
Search script details based on the script ID or the script name.
Input ParametersInput Parameters
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
{id} as Path parameter |
Optional |
string |
Provide Script ID or script name for which you want to fetch the details |
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: Fetch Script detailsSample: Fetch Script details
The script content is in base64-encoded format.
API Request:
curl-X GET
'https://<qualys_base_url>/sm/v1/scripts/16012'
--header'Content-Type:application/json'
--header'Authorization:Bearer '
--data-raw'
Response
{
"body":{
"id":"<SCRIPT ID>",
"customerUUId":"<CUSTOMER UUID>",
"title":"<SCRIPT TITLE>",
"description":"",
"category":{
"id":6,
"name":"<SCRIPT NAME>"
},
"scriptStatus":"APPROVED",
"importedFromId":0,
"platform":"WINDOWS",
"severity":2,
"threshold":12,
"type":{
"id":1,
"name":"Python"
},
"content":"<SCRIPT CONTENT>",
"recurringDay":0,
"approverId":"<USER ID OF APPROVER>",
"approverName":"<USER NAME OF APPROVER>",
"created":{
"dateTime":1651846745520,
"user":{
"id":"<SCRIPT ID>",
"name":"<USER NAME>"
},
"updated":{
"dateTime":1652865043670,
"user":{
"id":"<USER ID>",
"name":"<USER NAME>"",
}
},
""lastExecutedDateTime"":1652865043670,
""hasBlacklistedCommands"":true,
""blacklistedCommands"":""os.chmod",
"wget.download""\"
}
}"
To know the details of the response codes, refer to Appendix.