List Software Components for Specific Asset ID

[POST]/rest/2.0/am/asset/component/{assetId}

This API helps you to get the list of software components for a specific assetId discovered from the SwCA scan. 

Input ParametersInput Parameters

Parameter

Mandatory
/Optional

Data Type

Description

assetId Mandatory String Provide the assetId. You get the list of components for the assetId you provide.
pageSize Mandatory Number Provide the input for the page size between 1 to 1000. The default value is 500.
lastSeenAssetComponentId Optional Number You can see the value of the attribute assetComponentId at the last JSON object at the end of the API response. This value is a reference to fetch the asset-component details for the next page. For the first page request, this value is not required. After you get the response of the first page, this value should be added to the API request to get the next page of the asset-component details.

Sample - List of Software Components for Specific AssetIDSample - List of Software Components for Specific AssetID

API Request - without filter

curl --location --request POST 
'<qualys_base_url>/rest/2.0/am/asset/component/{assetId}?pageSize=500&lastSeenAssetComponentId=1735285554061' 
--header 'Authorization: Bearer <JWT Token>' 
--header 'Content-Type: application/json'

API Request - with filter

curl --location --request POST 
'<qualys_base_url>/rest/2.0/am/asset/component/51449686?pageSize=500&lastSeenAssetComponentId=1735285554061' 
--header 'Authorization: Bearer <JWT Token>' 
--header 'Content-Type: application/json' 
--data-raw '<SoftwareComponentFilterRequest>'

API Request Body - with component filter

<SoftwareComponentFilterRequest>
    <componentFilter>
        <filters>
            <criteria field="component.name" operator="EQUALS">
                <value>log4j</value>
            </criteria>
        </filters>
    </componentFilter>
</SoftwareComponentFilterRequest>

API Response

{
  "responseMessage": "Valid API Access",
  "count": 2,
  "responseCode": "SUCCESS",
  "hasMore": 1,
  "lastAssetComponentId": 1735285554061,
  "assetId": 51449686,
  "componentsList": [
    {
      "assetComponentId": 1735285554060,
      "name": "apache-common-utils",
      "version": "2.2",
      "technology": ".NET",
      "installPath": "/opt/apache/bin/apache-http/2.2/lib",
      "firstFoundAt": 1733129367228,
      "lastFoundAt": 1733129367228
    },
    {
      "assetComponentId": 1735285554061,
      "name": "apache-common-utils",
      "version": "2.3",
      "technology": ".NET",
      "installPath": "/opt/apache/bin/apache-http/2.3/lib",
      "firstFoundAt": 1733129367228,
      "lastFoundAt": 1733129367228
    }
  ]
}

Response codes

  • responseCode= "200", description= "SUCCESS"
  • responseCode= "204", description= "NO_CONTENT: The server has not found anything matching the Request"
  • responseCode= "400", description= "The request could not be understood by the server due to malformed syntax"
  • responseCode= "500", description= "Failure: The server encountered an unexpected condition which prevented it from fulfilling the request"