Import Scripts API
This API lets you import scripts from the Library.
Import Scripts Version 2 API
Input ParametersInput Parameters
| Parameter | Mandatory/Optional | Data Type | Description |
|---|---|---|---|
| title | Mandatory | String | Name of the script to be imported |
| categodyID | Mandatory | String | Category ID of the script to be imported |
| approved | Mandatory | Boolean | Status of the script to be imported {true/false} |
| id | Mandatory | String | ID of the script in the library |
| typeId | Mandatory | Integer | Provide a valid script type ID (Custom Script/Custom QID). |
| subType | Mandatory
(This parameter is mandatory only when the script type is Custom Script) |
String | Provide a subtype value to label the script.
Accepted values:
|
| typeName | Mandatory | String | Provide the name of the script type.
You can fetch the script types using the following API: The available script types are:
|
API Request
curl -X POST
'<qualys_base_url>/sm/v2/script-library/import'
--header 'Content-Type: application/json
--header 'Authorization: Bearer {{authToken}}'
--data '{
"title": "Sample Title",
"categoryId": 1,
"id": 234564,
"approved": true,
"typeId": 1,
"typeName": "Custom Script",
"subType": "Detection"
}'
Response
{
"errorCode": "0",
"message": "Script created from library successfully",
"body": {
"id": 86174
}
}
Import Scripts Version 1 API
Input ParametersInput Parameters
| Parameter | Mandatory/Optional | Data Type | Description |
|---|---|---|---|
| title | Mandatory | String | Name of the script to be imported |
| categodyID | Mandatory | String | Category ID of the script to be imported |
| approved | Mandatory | Boolean | Status of the script to be imported {true/false} |
| id | Mandatory | String | ID of the script in the library |
| typeId | Mandatory | Integer | Provide a valid script type ID (Custom Script/Custom QID). |
API Request
curl -X POST 'https://<qualys_base_url>/sm/v1/script-library/import'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {{authToken}}'
--data
'{
"title": "Sample Title",
"categoryId": 1,
"id": 234564,
"approved": true/false,
"typeId": 1
}'
Response
{
"errorCode": "0",
"message": "Script created from library successfully",
"body": {
"id": 86174
}
}
To know the details of the response codes, refer to Appendix.