Get Top Consumers
GET /obp/v7.0.0/management/metrics/top-consumers
OBPv7.0.0-getTopConsumers Roles: CanReadMetrics MetricAPI
Get the Consumers (apps) behind the API traffic: one row per distinct consumer with its call count, sorted by count descending.
Unlike the v3.1.0 version — which joins metric rows to consumers by APP NAME, dropping
calls whose app name no longer matches a consumer and double-counting duplicate names —
this groups by the consumer id stored on each metric row. For a given window and filters
the number of distinct consumers listed here therefore matches the
distinct_consumer_count field of GET /management/aggregate-metrics. Calls that carried
no consumer are excluded. app_name and developer_email are empty when the consumer
row no longer exists.
require CanReadMetrics role
Should be able to filter on the following fields
eg: /management/metrics/top-consumers?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=50
1 from_date (defaults to one year ago) eg:from_date=1100-01-01T01:01:01.000Z
2 to_date (defaults to the current date) eg:to_date=1100-01-01T01:01:01.000Z
3 consumer_id (if null ignore)
4 user_id (if null ignore)
5 anon (if null ignore) only support two value : true (return where user_id is null) or false (return where user_id is not null)
6 url (if null ignore), note: can not contain '&'.
7 app_name (if null ignore)
8 implemented_by_partial_function (if null ignore)
9 implemented_in_version (if null ignore)
10 verb (if null ignore)
11 correlation_id (if null ignore)
12 limit (defaults to 50) eg: limit=200
User Authentication is Required. The User must be logged in. The Application must also be authenticated.
JSON response body fields (5)
- app_name
- appNameBank
- consumer_id
- 7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh
- count
- developer_email
- top_consumers
Example success response
{
"top_consumers": [
{
"count": 1000,
"consumer_id": "7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh",
"app_name": "API-EXPLORER",
"developer_email": "developer@example.com"
},
{
"count": 250,
"consumer_id": "8uy8a7e4-6d02-40e3-a129-0b2bf89de8uh",
"app_name": "API-Manager",
"developer_email": "manager@example.com"
}
]
}Possible errors (5)
- OBP-20001: User not logged in. Authentication is required!
- OBP-20006: User is missing one or more roles:
- OBP-10016: Incorrect filter Parameters in URL.
- OBP-30552: Could not get the top consumers from database.
- OBP-50000: Unknown Error.