Fetch Cloud Agents Assigned via Direct Assignment API

GET /caui/1.0/config-profiles/<profile-id>/agents

Using this API you can generate the list of Cloud Agents for which the configuration profile is assigned using direct assignment API. This API saves lot of manual efforts as you are no longer required to check each and every configuration profile to see which Cloud Agents are using directly assigned configuration profile.

Input ParameterInput Parameter

The following are the input parameters you can use to generate the list of directly assigned Cloud Agents:

Parameter Optional/Mandatory Data Type Description
limit Optional Integer

This parameter specifies the number of Cloud Agent records to be generated.

If you do not define this parameter in the API request, API generates the list of all Cloud Agents assigned using Direct Assignment API. Range: 1-200.

pageNumber Optional Integer

This parameter defines the number of pages to be displayed in the API response. 

By default, one page contains 10 configuration profiles.
Range: 0,1,2,3, and so on.

Sample: Fetch Cloud Agents Assigned via Direct Assignment APISample: Fetch Cloud Agents Assigned via Direct Assignment API

This sample illustrates fetching the list of directly assigned Cloud Agents by specifying the limit and pageNumber parameters.

API Request

 
    curl --location --request GET '<qualys_base_url>/caui/1.0/config-profiles/1832693/agents' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer [jwt token]' \
    

API Request Body

 
    --data'
    {
      "limit": 1,
      "pageNumber":0
    }
    

API Response

 
    {
       "metadata":
         {
           "pageNumber": 0,
           "pageSize": 1,
           "totalResultCount": 1
         },
       "content": [
         {
           "hostName": "win11-23h2-buil",
           "agentVersion": "6.99.0.0",
           "id": 52906903
         }
      ]
    }
    

Sample: Fetch Cloud Agent list without Specifying Input ParametersSample: Fetch Cloud Agent list without Specifying Input Parameters

This sample illustrates fetching the list of directly assigned Cloud Agents without specifying the limit and pageNumber parameters.

API Request

    curl --location --request GET '<qualys_base_url>/caui/1.0/config-profiles/1832693/agents' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer [jwt token]' \
    

API Response

 
    {
      "metadata":{
        "pageNumber": 0,
        "pageSize": 10,
        "totalResultCount": 2
      },
      "content": [
        {             
           "hostName": "win11agentvs",
           "agentVersion": "6.1.0.30",
           "id": 57740981
        },
        {
           "hostName": "DESKTOP-N8424UB",
           "agentVersion": "6.1.0.22",
           "id": 54345595         
        }
      ]
    }
    

Sample: Fetch Cloud Agent List with Incorrect Profile IDSample: Fetch Cloud Agent List with Incorrect Profile ID

When you provide the incorrect configuration profile ID in the API request, the API generates an error message. The following exammple illustrates using incorrect configuration profile ID to fetch the list of directly assigned Cloud Agents.

API Request

 
    curl --location --request GET '<qualys_base_url>/caui/1.0/config-profiles/88800/agents' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer [jwt token]' \
    

API Response

 
  {     
     "code": 404,
     "message": "Unable to fetch requested configuration. Configuration does not exist.",     
     "timestamp": 1743489431887 
  }
    

Sample: Fetch Cloud Agent list with Invalid Parameter ValuesSample: Fetch Cloud Agent list with Invalid Parameter Values

When you enter the invalid values for input parameter, you get errors in the API response. The following sample illustrates fetching directly assigned Cloud Agent records by providing invalid input parameters.  

API Request

 
    curl --location --request GET '<qualys_base_url>/caui/1.0/config-profiles/88800/agents' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer [jwt token]' \
    

API Request Body

 
  {
      "limit": 0,
      "pageNumber": -1, 
  }
   

API Response

 
    {     
       "code": 400,
       "message": "[Value should be zero or a positive number for property : 'pageNumber',
       Value should be a positive number for property : 'limit']",     
       "timestamp": 1743489499975 
    }