Activity-based APIs

Use the following API function to fetch activity logs:

List Activity Logs

Search for activities such as create, approve, deprecate, execute, modify, and test carried out by CAR users.

POST/sm/v1/scripts/activities

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

QQL

Optional

string

ilter the activities by providing a query using Qualys syntax.

   Refer to the “How to Search” topic in the online help for

   assistance with creating your query.

   For example – "activity: CREATE"

 

pageNumber

Optional

string

The page to be returned. Starts from zero.

pageSize

Optional

string

The number of records per page to be included in the response. The default value is 10.

sort

Optional

string

Sort the results using a Qualys token. For example, ID, Category and so on.

[{\"Created.dateTime\":\"asc\"}]

startDate, EndDate

Optional

string

Provide the start date and the end date to fetch results between a specified time frame.

 Sample: Filter Based on the Activity Type, Such as Create, Approve, Deprecate, Execute, Modify, Reject Sample: Filter Based on the Activity Type, Such as Create, Approve, Deprecate, Execute, Modify, Reject

API Request

 "curl --location --request POST""https:// /sm/v1/scripts/activi­ties""\\<qualys_base_url>
--header""Content-Type: application/json""\\
--header""Authorization: Bearer <authToken>""\\
--data-raw""'{
\"qql\": \"activity: CREATE \"
}"

Response



{
   "   ""auditRecords":[
      "       "{
         "           ""id":"a563f016-8a1e-46ca-9d5f-f30a5df7f860",
         "           ""auditEnabledAppId":1,
         "           ""applicationName":"SM",
         "           ""userName":"<USER NAME>",
         "           ""userUuid":"<USER UUID>",
         "           ""customerUuid":"<CUSTOMER UUID>",
         "           ""client":null,
         "           ""sourceIp":null,
         "           ""createdDate":1651206222012,
         "           ""targetType":"script",
         "           ""targetName":"testFor",
         "           ""action":"CREATE",
         "           ""auditComment":null,
         "           ""externalChangeLink":null,
         "           ""customFields":[
            "               "{
               "                   ""key":"targetId",
               "                   ""value":"16016""               "
            }"           "
         ]"       "
      },
      "       "{
         "   "
      ],
      "   ""totalCount":1,
      "   ""pageNumber":0,
      "   ""pageSize":10,
      "   ""applicationName":"SM",
      "   ""clientApp":"SM",
      "   ""auditEnabledAppId":1
   }      

 

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