GET Analytics Certificates Count

The GET /Analytics/Certificates/Count operation returns the number of certificates that match the supplied parameters. On success, the operation returns HTTP 200 OK with  the certificate count.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:

/certificates/collections/read/
OR
/certificates/collections/read/#/

Permissions for certificates can be set at the system-wide or resource-specific level. The appropriate level depends on how the certificates are accessed. See Certificate Collection Permissions for more information.

In permission strings, # represents a specific resource identifier. In /certificates/collections/ permission strings it refers to a certificate collection ID (for example, CollectionId) and in /certificate_stores/ permission strings it refers to a certificate store application ID (for example, containerId).

Table 231: GET Analytics Certificates Count Input Parameters

Name In Description
Query Query

A string containing a query to limit the results (for example, field1 -eq value1 AND field2 -gt value2). The default is to return all records. For querying guidelines, refer to: Using Search in the Management Portal.

The query fields supported for this operation are the same as those for certificate search. Advanced searches are supported.

This allows for creating a custom query to generate a certificate count. The query should be formatted like the context field on the certificate search page, for example:

(CN -contains "appsrvr" AND IssuedDate -ge "01/01/2025") OR (CN -contains "appsrvr" AND TemplateShortName -contains "web")
collectionId Query

Required. An integer that represents the ID of the collection to query to generate the certificate count.

Use 0 for All Certificates (built-in collection).

Use the GET Certificate Collections operation to retrieve a list of all the certificate collections to determine the collection ID.

Table 232: GET Analytics Certificates Count Response Data

Name Description
Count

An integer that represents the count of certificates that match the supplied parameters.