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
- POSTIngest event if a user is entitled to a feature
- GETGet Feature credits balance
- GETList feature credits entries of a feature for an account
- PATCHUpdate a feature credits entry
- POSTVoid a feature credits entry of a feature for an account
- GETGet entitlements for a account
- POSTCheck entitlement value for a account
- GETGet entitlement value for a account
- POST
- Event Management
- Metrics
- Credits
- Invoices
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
Ingest event if a user is entitled to a feature
This API let’s you to ingest an event if a user is entitled to a feature
curl --request POST \
--url https://api.togai.com/entitled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"event": {
"schemaName": "<string>",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"timestamp": "2022-06-15T07:30:35.123",
"accountId": 1,
"attributes": [
{
"name": "message",
"value": 100,
"unit": "characters"
}
],
"dimensions": {}
}
}'
{
"success": true
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Payload for ingesting events
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"
Response
true
curl --request POST \
--url https://api.togai.com/entitled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"event": {
"schemaName": "<string>",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"timestamp": "2022-06-15T07:30:35.123",
"accountId": 1,
"attributes": [
{
"name": "message",
"value": 100,
"unit": "characters"
}
],
"dimensions": {}
}
}'
{
"success": true
}