Use this API to fetch the patches count for a specified customer after applying the provided filters and group by terms.
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
groupBy |
Optional |
string |
Specify the group by criteria. For example, appFamily. |
havingQuery |
Optional |
string |
Specify a QQL to filter patches based on asset search criteria. For example, status:scanned |
limit |
Optional |
string |
Specify the number of patches to return. |
platform |
Optional |
string |
The platform type. - Available values: Linux, Windows - Default value: Windows |
query |
Optional |
string |
Specify a QQL to filter patches based on patch catalog search criteria For example, appFamily:Firefox Append the QQL (patchStatus:[Missing,Installed] and isSuperseded:false) to filter the latest missing and installed patches. |
sort |
Optional |
string |
Sort the patch values by certain data. For example, [{"appFamily":"asc"}] Note: The request must contain the same token for groupby and sort. |
API request
curl -X GET
"https://<QualysBaseURL>/pm/v1/patches/count?groupBy=vendorSeverity&groupBy=appFamily&havingQuery=name%3A%22Windows%22&platform=Windows&query=isSecurity%3A%20true%20and%20%28patchStatus%3A%5BMissing%2C%20Installed%5D%20and%20isSuperseded%3A%20false%29&sort=%5B%7B%22vendorSeverity%22%3A%22asc%22%7D%5D" -H "accept: application/json" -H "Authorization: Bearer <<jwt token>>"
Response
{
"vendorSeverity": {
"Critical": 28,
"Important": 58,
"Low": 2,
"Moderate": 2,
"None": 24
},
"appFamily": {
"Windows": 34,
"Office": 25,
"Office Viewer": 24,
".Net": 23,
"Lync": 23,
"Visual C++": 12,
"Notepad++": 4,
"Chrome": 2,
"Cisco Jabber": 2,
"Node.js": 2,
"Windows Defender": 2,
"Edge": 1,
"Firefox": 1,
"GIT": 1,
"Internet Explorer": 1,
"Plantronics Hub": 1,
"Reader": 1,
"SQL Server": 1,
"WinSCP": 1
}
}