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
Ingest events to Togai in batch
This API let’s you to ingest events in batch upto 500 events. Ingest large amounts of events up to 500 in batches in an array using this API.
curl --request POST \
--url https://api.togai.com/ingestBatch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"timestamp": "2022-06-15T07:30:35.123",
"schemaName": "travelCompletedEvent",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"accountId": "1",
"attributes": [
{
"name": "distanceTravelled",
"value": "50",
"unit": "Miles"
},
{
"name": "timeSpent",
"value": "60",
"unit": "Minutes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": "1234",
"travelType": "Business"
}
},
{
"timestamp": "2022-06-15T07:30:35.123",
"schemaName": "sendMessageEvent",
"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"
}
}
]
}'
{
"success": true
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Payload for ingesting batch events
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.
The event will be associated with the provided account
512
Attributes are numeric values. It can be usage metric which you push to Togai
Name of the event attribute
1 - 50
Value of the event attribute
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
Dimensions are tags/labels associated with the events.
1 - 200
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
curl --request POST \
--url https://api.togai.com/ingestBatch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"timestamp": "2022-06-15T07:30:35.123",
"schemaName": "travelCompletedEvent",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"accountId": "1",
"attributes": [
{
"name": "distanceTravelled",
"value": "50",
"unit": "Miles"
},
{
"name": "timeSpent",
"value": "60",
"unit": "Minutes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": "1234",
"travelType": "Business"
}
},
{
"timestamp": "2022-06-15T07:30:35.123",
"schemaName": "sendMessageEvent",
"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"
}
}
]
}'
{
"success": true
}