Export Scripts API

Export one or more scripts by providing script IDs in query parameter.

GETsm/v1/scripts/export

Note: The script content is in base64-encoded format.

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

Authorization 

 Mandatory

String

Authorization token to authenticate to the Qualys Enterprise TruRisk™ Platform.

Prepend the token with "Bearer", followed by a space. For example,

Bearer <authToken>

IDs as query parameter

 Optional

Integer

Provide single or multiple script IDs as the query parameter. For example:

https://gate­way.xxx.eng.xxx.qualys.com/sm/v1/scripts/exportids=<SCRIPT ID1>,<SCRIPT ID2>

SampleSample

API Request

 "curl --location --request GET""https://qualys_base_url/sm/v1/scripts/exportids=16515""\\
--header""Authorization: Bearer <authToken>""You can export multiple scripts by providing multiple comma-separated script IDs.
For example",
"https"://gateway.xxx.eng.xxx.qualys.com/sm/v1/scripts/export ids=72652,
75508

       
    

Response


[
   "    "{
      "        ""id": <SCRIPT ID1>,
      "        ""customerUUId":" ""<CUSTOMER UUID>",
      "        ""title":" ""<SCRIPT TITLE>",
      "        ""description":" """,
      "        ""category":" "{
         "            ""id": 5,
         "            ""name":" ""System Administration""        "
      },
      "        ""scriptStatus":" ""APPROVED",
      "        ""importedFromId": 0,
      "        ""platform":" ""WINDOWS",
      "        ""severity": 3,
      "        ""threshold": 50,
      "        ""type":" "{
         "            ""id": 1,
         "            ""name":" ""Python""        "
      },
      "        ""content":" ""<SCRIPT CONTENT>",
      "        ""recurringDay": 0,
      "        ""approverId":" ""<APPROVER ID>",
      "        ""created":" "{
         "            ""dateTime": 1651745523598,
         "            ""user":" "{
            "                ""id":" ""51fbdb4b-5fb5-fdf6-8141-5a7887ec557b",
            "                ""name":" ""FIM Automation""            "
         }"        "
      },
      "        ""updated":" "{
         "            ""dateTime": 1652674833932,
         "            ""user":" "{
            "                ""id":" ""51fbdb4b-5fb5-fdf6-8141-5a7887ec557b",
            "                ""name":" ""FIM Automation""            "
         }"        "
      },
      "        ""lastExecutedDateTime": 1652684748401,
      "        ""hasBlacklistedCommands":" true",
      "        ""blacklistedCommands":" ""os.chmod, wget.download""    "
   },
   "    "{
      "        ""id": <SCRIPT ID2>,
      "        ""customerUUId":" ""<CUSTOMER UUID>",
      "        ""title":" ""<SCRIPT TITLE>",
      "        ""description":" """,
      "        ""category":" "{
         "            ""id": 5,
         "            ""name":" ""System Administration""        "
      },
      "        ""scriptStatus":" ""APPROVED",
      "        ""importedFromId": 0,
      "        ""platform":" ""WINDOWS",
      "        ""severity": 3,
      "        ""threshold": 50,
      "        ""type":" "{
         "            ""id": 1,
         "            ""name":" ""Python""        "
      },
      "        ""content":" ""<SCRIPT CONTENT>",
      "        ""recurringDay": 0,
      "        ""approverId":" ""<APPROVER ID>",
      "        ""approverName":" ""FIM Automation",
      "        ""created":" "{
         "            ""dateTime": 1651748729939,
         "            ""user":" "{
            "                ""id":" ""51fbdb4b-5fb5-fdf6-8141-5a7887ec557b",
            "                ""name":" ""FIM Automation""            "
         }"        "
      },
      "        ""updated":" "{
         "            ""dateTime": 1652674850859,
         "            ""user":" "{
            "                ""id":" ""51fbdb4b-5fb5-fdf6-8141-5a7887ec557b",
            "                ""name":" ""FIM Automation""            "
         }"        "
      },
      "        ""lastExecutedDateTime": 1652674850859,
      "        ""hasBlacklistedCommands":" true",
      "        ""blacklistedCommands":" ""os.chmod, wget.download""    "
   }
]"Note":The script content is in base64-encoded format.       
    

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