List Assets for a Certificate 

POST/certview/v1/certificates/{certhash}/assets

 

Use this API function to retrieve a list of the assets of the specific certificate. Use cert hash as an input query. The response contains all the asset details of the specific certificate. View details of assets like tags and instances. Use this API to get all the assets when the certificate has more than 1000 assets. If the total count exceeds the number of results returned, you can fetch the next page by calling the API again with the next page number.

 You can see only those assets that have been assigned by your manager user. When you send an API request, you can access information about the assets and their corresponding certificates assigned to you, based on scope. For more information on tag-based user scoping refer to Certificate View Online help.

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

certhash

 Mandatory

string

Query parameter- Provide hash of the certificate.

attributes

Optional

string 

Provide specific attributes to display additional asset details based on

  • tags: View certificate list of assets with specified tags.

  • hostInstances: View the certificate list which contains list of instances on which this certificate was found.

  • tags and hostInstances: View the certificate list which contains all the primitive details of the assets along with the asset tags and instances on which this certificate was found.

filter 

Optional

String

Filter the events list by providing a query using Qualys syntax. Refer to the How to Search topic in the online help for assistance with creating your query.

For example - expiryGroup: Expired

Refer to the list of tokens you can use to build the query: Search tokens

pageNumber 

Optional

Integer

The page to be returned. Starts from zero.

pageSize

Optional

Integer

Provide the number of records per page to be included in the response.

Default: 10.

Maximum: 200

For example, the total result set is 8000 assets. If the page size is specified as 80, then the result is divided in 100 pages with 80 assets each.

Note: Use a combination of pageNumber and pageSize parameters to ensure that the results returned are less than 10000 records. If it exceeds 10000 records, then an error message is displayed.

sort 

Optional

String

Sort the results in ascending or descending order.

By default, the result is sorted by {updated: desc}

Note: This API supports only new query format. For more details, refer to the following query example

Example

If you want to view the certificate with asset name server1

Old Format

asset.name:server1

New Format

asset:(name:server1)

Sample with all Parameters DefinedSample with all Parameters Defined

API Request

curl -X POST  
"<qualys_base_url>/certview/v1/certificates/<certhash>/assets" --header "Accept: application/json" 
-H "Authorization: Bearer <JWT Token>" 
-d "{\"certificateDetails\":\"basic\"   

Response


       [
  {
    "netbiosName": "",
    "assetId": "8d6d19b5-9201-445b-87c2-b61aeb3f4fa5",
    "name": "ABC.COM",
    "operatingSystem": "NetScaler",
    "created": 1587464966000,
    "updated": 1625213136000,
    "assetInterfaces": [
      {
        "hostname": "ABC.COM",
        "address": "64.xx.96.133"
      }
    ],
    "certificateCount": 0
  },
  {
    "netbiosName": "",
    "assetId": "2a9428e4-9130-4979-9f8c-dcfe86579c39",
    "name": "Server1",
    "operatingSystem": "NetScaler",
    "created": 1591703972000,
    "updated": 1624014415000,
    "assetInterfaces": [
      {
        "hostname": "ABC.COM",
        "address": "10.XXX.X.XX"
      }
    ],
    "certificateCount": 0
  }
]