Usage Meters
List usage meters for event schema
Get a list of usage meters associated with an event schema
GET
/
usage_meters
curl --request GET \
--url https://api.togai.com/usage_meters \
--header 'Authorization: <authorization>'
{
"data": [
{
"id": "01BX5ZZKBKACTAV9WEVG",
"name": "Rides",
"description": "Cab rides",
"type": "COUNTER",
"aggregation": "COUNT",
"status": "DRAFT",
"computations": [
{
"matcher": "{\n \"and\": [\n {\"in\": [{\"var\": \"dimension.city\"}, \"chennai\", \"mumbai\"]},\n \"or\": [\n {\">\": [{\"var\": \"attribute.distance\"}, 100]},\n {\"<\": [{\"var\": \"attribute.distance\"}, 20]}\n ]\n ]\n}\n",
"computation": "1"
}
]
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==",
"context": {
"pageSize": 10
}
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
status
enum<string>
Filter by status
Available options:
ACTIVE
, INACTIVE
aggregations
enum<string>
Filter by aggregations
Available options:
COUNT
, SUM
nextToken
string
pageSize
number
Response
200 - application/json
data
object[]
nextToken
string
context
object
curl --request GET \
--url https://api.togai.com/usage_meters \
--header 'Authorization: <authorization>'
{
"data": [
{
"id": "01BX5ZZKBKACTAV9WEVG",
"name": "Rides",
"description": "Cab rides",
"type": "COUNTER",
"aggregation": "COUNT",
"status": "DRAFT",
"computations": [
{
"matcher": "{\n \"and\": [\n {\"in\": [{\"var\": \"dimension.city\"}, \"chennai\", \"mumbai\"]},\n \"or\": [\n {\">\": [{\"var\": \"attribute.distance\"}, 100]},\n {\"<\": [{\"var\": \"attribute.distance\"}, 20]}\n ]\n ]\n}\n",
"computation": "1"
}
]
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==",
"context": {
"pageSize": 10
}
}