Guides
...
Usage Metering
Usage Reporting
Querying Usage
2min
Usage API payload:
usage
1{
2 "meterApiName": "ApiCalls",
3 "aggregation": "SUM",
4 "timeGroupingInterval": "Day",
5 "timeRange": {
6 "startTimeInSeconds": 1619293642
7 },
8 "filter": { "customerId": ["xxx", "yyy"]},
9 "groupBy": ["customerId"],
10 "take": {
11 "limit": 10,
12 "isAscending": false
13 }
14}
API response breakdown:
Sample API response:
usage response
1{
2 "metadata": {
3 "account": null,
4 "meterApiName": "ApiCalls",
5 "aggregation": "sum",
6 "timeRange": {
7 "startTimeInSeconds": 1619294851,
8 "endTimeInSeconds": 1619467650
9 },
10 "filter": {
11 "customerId": [
12 "xxx",
13 "yyy"
14 ]
15 },
16 "groupBy": [
17 "customerId"
18 ],
19 "take": {
20 "limit": 10,
21 "isAscending": false
22 },
23 "timeGroupingInterval": "day"
24 },
25 "secondsSinceEpochIntervals": [
26 1619222400,
27 1619308800,
28 1619395200
29 ],
30 "clientMeters": [
31 {
32 "group": {
33 "groupInfo": {
34 "customerId": "xxx"
35 }
36 },
37 "groupValue": 23645.0,
38 "values": [
39 {
40 "percentageFromPrevious": 0.0,
41 "value": 0.0,
42 "secondsSinceEpochUtc": 1619222400
43 },
44 {
45 "percentageFromPrevious": 100.0,
46 "value": 4040.0,
47 "secondsSinceEpochUtc": 1619308800
48 },
49 {
50 "percentageFromPrevious": 385.2722772277228,
51 "value": 19605.0,
52 "secondsSinceEpochUtc": 1619395200
53 }
54 ]
55 },
56 {
57 "group": {
58 "groupInfo": {
59 "customerId": "yyy"
60 }
61 },
62 "groupValue": 22608.0,
63 "values": [
64 {
65 "percentageFromPrevious": 0.0,
66 "value": 0.0,
67 "secondsSinceEpochUtc": 1619222400
68 },
69 {
70 "percentageFromPrevious": 100.0,
71 "value": 2507.0,
72 "secondsSinceEpochUtc": 1619308800
73 },
74 {
75 "percentageFromPrevious": 701.7949740725967,
76 "value": 20101.0,
77 "secondsSinceEpochUtc": 1619395200
78 }
79 ]
80 }
81 ]
82}
Updated 30 Oct 2024
Did this page help you?