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.
Parameter |
Required/Optional |
Data Type |
Description |
---|---|---|---|
policyId |
Required |
Integer |
Policy IDs for compliance evaluation. |
Request header: Authorization |
Required |
String |
JWT encrypted token. Note: Provide the token received from the Authorization API as the input. |
lastScanDate |
Optional |
Integer |
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 |
API Request
curl -X GET https://<qualys_base_url>/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>"
]
}
]
API Request
curl -X GET https://<qualys_base_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>"
]
}
]
API Request
curl -X GET https://<qualys_base_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>",
]
}
]