Resolve Host IDs

API URL:

/pcrs/1.0/posture/hostids?policyId=policyId1, policyId2

[GET]

List all Host IDs for the specified policies.

For the Resolve Host IDs API, you must use the token that is returned by the authentication request. You can include a maximum of 10 policies in one API request.

Input Parameters

Parameter

Description

policyId

(Required) Policy IDs for compliance evaluation.

Request header:

Authorization

(Required) JWT encrypted token.

Note: Provide the token received from the Authorization API as the input.

lastScanDate

(Optional) Get host IDs based on the specified date on which they were last scanned.

The formats for date are:

lastScanDate=YYYY-MM-DD

For example:

lastScanDate=2022-05-25

Or,

lastScanDate=2022-05-25T18:48:16Z

 

Sample - JSON Output Response - Resolve Host IDs

Resolve Host IDs with single policy ID

API Request

curl -X GET https://gateway.<assignedURL>/pcrs/1.0/posture/hostids?policyId=<POLICY ID>

-H "accept:*/*"

-H "Authorization: Bearer <token>"

JSON Output

[

{

"policyId": "<POLICY ID>",

"subscriptionId": "SUBSCRIPTION ID",

"hostIds": [

"<HOST ID>"

]

}

]

Resolve Host IDs with multiple policy IDs

API Request

curl -X GET https://gateway.<assigned URL>/pcrs/1.0/posture/hostids?policyId=xxx,xxx

-H "accept: */*"

-H

"Authorization: Bearer <token>"

JSON Output

[

{

"policyId": "<POLICY ID>",

"subscriptionId": "<SUBSCRIPTION ID>",

"hostIds": [

"<HOST ID>"

]

},

{

"policyId": "<POLICY ID>",

"subscriptionId": "SUBSCRIPTION ID",

"hostIds": [

"<HOST ID>"

]

}

]

Resolve Host IDs based on the specified last scan date

API Request

curl -X GET https://gateway.<assigned URL>/pcrs/1.0/posture/hostids?policyId=4677689&lastScanDate=2022-05-25

-H "accept: */*"

-H

"Authorization: <token>"

 

 

JSON Output

[

    {

        "policyId": "4677689",

        "subscriptionId": "<SUBSCRIPTION ID>",

        "hostIds": [

            "<HOST ID 1>",

            "<HOST ID 2>",

            "<HOST ID 3>",

            "<HOST ID 4>",

            "<HOST ID 5>",

        ]

    }

]

 

 

Related Topics

PC Posture Streaming APIs

Get Policy IDs

Get Posture Info