Get aggregated counts by field
Learn more about how to retrieve aggregated counts grouped by a specified field for summary reporting and dashboard use cases.
Use Get aggregated counts by field API to return aggregated counts grouped by a specified field, such as lookupType, status, or source. You can also apply an optional filter expression and paginate results when the number of groups is large.
HTTP method and endpoint
Use the following HTTP method and endpoint path to submit the request:
GET /configuration/{tenantId}/autopilot/stats/_facets?field={field}&filter={filter}&max={max}&pageNo={pageNo}
The following table describes the endpoint path parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
tenantId | String | Yes | Tenant identifier |
Query parameters
The following table describes the query parameters.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
field | String | Yes | Field to aggregate on. | Examples: lookupType, status, source |
filter | String | No | Filter expression used to limit the aggregation scope. | Example: equals(status,"TRACKING") |
max | Integer | No | Number of groups to return per page. | Default: 10000 |
pageNo | Integer | No | Page number used to retrieve additional groups. | Default: 1 |
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Authorization | Bearer {token} | Yes |
Request body
This operation does not require a request body.
Response fields
The following table describes the fields returned in the response body if filed chosen is status.
| Field | Type | Description |
|---|---|---|
status | Object | Map of values and their aggregated counts for the requested field. |
TRACKING | Number | Count of records for the TRACKING value. |
AUTOMAPPED | Number | Count of records for the AUTOMAPPED value. |
REJECTED | Number | Count of records for the REJECTED value. |
MISSPELLED | Number | Count of records for the MISSPELLED value. |
lookuptype or source, the response may vary depending on your RDM configuration.Example response
The following example shows a successful response.
{
"status": {
"TRACKING": 25,
"AUTOMAPPED": 12,
"REJECTED": 3,
"MISSPELLED": 8
}
}