Introduction
APIs
- Authentication
- Customers
- Accounts
- Aliases
- Event Schemas
- Usage Meters
- AddOns
- Licenses
- Feature
- (Deprecated) Price Plans
- Price Plan V2
- Settings
- Price Experimentation
- Jobs
- Event Ingestion
- Entitlements
- Event Management
- Metrics
- Credits
- Invoices
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
Get a list of usage events with multiple query options
This API let’s you to fetch a list of events with multiple query parameters
curl --request GET \
--url https://api.togai.com/events \
--header 'Authorization: Bearer <token>'
{
"events": [
{
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "travelCompletedEvent",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"referenceId": "event.dsvhk32.234n3",
"accountId": "1",
"attributes": [
{
"name": "distanceTravelled",
"value": "50",
"unit": "Miles"
},
{
"name": "timeSpent",
"value": "60",
"unit": "Minutes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": "1234",
"travelType": "Business"
}
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_NOT_METERED",
"statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
},
"createdAt": "2021-03-04T14:25:10Z"
},
{
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "sendMessageEvent",
"referenceId": "event.dsvhk32.234n4",
"id": "c0b1306d-f506-43a6-856b-69221efaee6c",
"accountId": "1",
"attributes": [
{
"name": "messageSentCount",
"value": "50",
"unit": "None"
},
{
"name": "sizeOfMessage",
"value": "60",
"unit": "KiloBytes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": "1234",
"messageProviderName": "Twilio"
}
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_METERED",
"statusDescription": "Ingestion completed successfully"
},
"createdAt": "2021-03-04T14:25:10Z"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Pagination token used as a marker to get records from next page.
"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="
Filter option to filter by status.
Filter option to filter based on account id.
"1234"
Filter option to filter the events based on schema name.
"Rides"
Maximum page size expected by client to return the record list.
NOTE: Max page size cannot be more than 50. Also 50 is the default page size if no value is provided.
10
Response
Get batch events response
Raw usage event ingested by the business team and the status of the event ingestion.
Unique id generated by Togai to identify an event uniquely
Contents of the event
Name of the Event Schema. Know more about event schema
1 - 50
Source time stamp of the event. This timestamp must be in ISO 8601 format.
"2022-06-15T07:30:35.123"
The event will be associated with the provided account
512
1
Attributes are numeric values. It can be usage metric which you push to Togai
Metric to be recorded
Name of the event attribute
1 - 50
"message"
Value of the event attribute
100
Unit with which the attribute value was measured. Natively supported units - "Meters, Miles, Kilometers, Grams, Kilograms, ounces, Pounds, Minutes, Hours, Seconds, Milliseconds, Microseconds, None". Clients are free to add any other custom units.
1 - 50
"characters"
Dimensions are tags/labels associated with the events.
1 - 200
{ "Country": "India" }
Togai restricts users to ingest events with same id within a period of 45 days. This restriction is common for /entitled API, /ingest API and /ingestBatch API. i.e, an id used on /ingest API will not be allowed on /ingestBatch or /entitled APIs
512
"c0b1306d-f506-43a6-856b-69221efaee6b"
Status about the event ingestion.
Ingestion status
INGESTION_IN_PROGRESS
, INGESTION_FAILED
, INGESTION_FAILED_SCHEMA_NOT_DEFINED
, INGESTION_FAILED_ENRICHMENT_FAILED
, INGESTION_FAILED_UNITS_INVALID
, INGESTION_COMPLETED_NO_MATCHING_METERS
, INGESTION_COMPLETED_EVENT_METERED
, INGESTION_COMPLETED_EVENT_NOT_METERED
, INGESTION_FAILED_PAST_GRACE_PERIOD
, INGESTION_FAILED_ACCOUNT_NOT_FOUND
, INGESTION_FAILED_DUPLICATE_EVENT
, INGESTION_FAILED_NO_EVENT_ID
, INGESTION_FAILED_INVALID_NAMED_LICENSE_EVENT
, INGESTION_FAILED_INSUFFICIENT_CREDITS
, REVERTED
, UNKNOWN
"INGESTION_COMPLETED"
250
"Ingestion Completed successfully"
Created time stamp of the event. This timestamp must be in ISO 8601 format.
"2022-06-15T07:30:35.123"
The associated account belongs to this customer
50
"1"
500
"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="
curl --request GET \
--url https://api.togai.com/events \
--header 'Authorization: Bearer <token>'
{
"events": [
{
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "travelCompletedEvent",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"referenceId": "event.dsvhk32.234n3",
"accountId": "1",
"attributes": [
{
"name": "distanceTravelled",
"value": "50",
"unit": "Miles"
},
{
"name": "timeSpent",
"value": "60",
"unit": "Minutes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": "1234",
"travelType": "Business"
}
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_NOT_METERED",
"statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
},
"createdAt": "2021-03-04T14:25:10Z"
},
{
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "sendMessageEvent",
"referenceId": "event.dsvhk32.234n4",
"id": "c0b1306d-f506-43a6-856b-69221efaee6c",
"accountId": "1",
"attributes": [
{
"name": "messageSentCount",
"value": "50",
"unit": "None"
},
{
"name": "sizeOfMessage",
"value": "60",
"unit": "KiloBytes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": "1234",
"messageProviderName": "Twilio"
}
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_METERED",
"statusDescription": "Ingestion completed successfully"
},
"createdAt": "2021-03-04T14:25:10Z"
}
]
}