Get a List of Assets

Use this API to get a list of assets enabled for your Patch Management within your scope.

GET/pm/v1/assets

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

havingQuery

Optional

string

Specify a QQL to filter assets based on patch catalog search criteria.

For example, appFamily:Firefox

pageNumber

Optional

string

The page to be returned.

Default value: 0

pageSize

Optional

string

Limit number of rows to be returned per page.

Default value: 10

platform

Optional

string

The platform type.

- Available values: Linux, Windows

- Default value: Windows

query

Optional

string

Specify a QQL to filter assets based on asset search criteria.

For example, name:'Asset-windowsmachine1'

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, [{"name":"asc"}]

Sample - Get a list of assets in your scopeSample - Get a list of assets in your scope

API request

    
        curl -X GET 
        "https://<QualysBaseURL>/pm/v1/assets?havingQuery=isSecurity%3A%20true&pageNumber=0&pageSize=2&platform=Windows&query=%28scanDateTime%3A%5Bnow-2d%20...%20now-1s%5D%29%20and%20%28patchStatus%3A%5BMissing%5D%20and%20isSuperseded%3A%20false%29&sort=%5B%7B%22status%22%3A%22asc%22%7D%5D" -H "accept: application/json" -H "Authorization: Bearer <<jwt token>>""
    

Response

    
      [
    {
        "name": "WIN2012R2",
        "id": "a676efcf-8322-4fdc-b3b5-f3ed44f955a5",
        "operatingSystem": "Microsoft Windows Server 2012 R2 Standard 6.3.9600 64-bit N/A Build 9600",
        "lastLoggedOnUser": "Administrator",
        "scanStatus": "Scanned",
        "statusCode": 20211,
        "statusDateTime": 1642692958139,
        "scanDateTime": 1642692969154,
        "hardware": {
            "model": "",
            "manufacturer": ""
        },
        "tags": [
            {
                "id": "781270dc-02ba-45c3-9336-78edf4802c1d"
            },
            {
                "id": "65a57156-c983-4c5c-bc6b-4cf8585e894f"
            },
            {
                "id": "67978b5c-a9ef-4c02-b4ae-dc6f0f825063"
            },
            {
                "id": "59e00be0-1feb-46d5-80d9-980d80d4f032"
            },
            {
                "id": "8302ecad-4518-4fce-bce3-8ea764cd1e7c"
            }
        ],
        "interfaces": [],
        "version": "Microsoft Windows Server 2012 R2 Standard 6.3.9600 Build 9600",
        "architecture": "x64",
        "osIdentifier": "WINDOWS",
        "platform": "Windows",
        "missingCount": 274,
        "installedCount": 6
    }
]