Tracking API
The Tracking API allows you to record and manage custom events in your application. Use this API to track important user actions, business metrics, and other significant events that you want to monitor and analyze.
Key features:
- Create custom events with names, values, and metadata
- Filter and retrieve events based on various criteria
- Support for pagination and result limiting
- Flexible metadata structure for detailed event tracking
Create event
Publish a new event.
eventName and value are required.
Endpoint
POST https://developer-api.oppizi.com/tracking/eventsParameters
eventName required
Name of event
value required
Value of event
metadata optional
Could be key/value as string or string[].
Supports maximum 50 entries.
Key length has a limit of 40 characters maximum. Value length has a limit of 256 characters maximum.
Request body
{
"eventName": "Purchase",
"value": 250,
"metadata": {
"orderId": 182394
}
}Example
fetch('https://developer-api.oppizi.com/tracking/events', {
method: 'POST',
headers: new Headers({
'Content-Type': 'application/json',
Authorization: 'Bearer YOUR_SECRET_KEY',
}),
body: JSON.stringify({
eventName: 'Purchase',
value: 250,
metadata: {
amount: 250,
},
}),
});Get events
Returns a list of your events. The events are sorted by creation date, from newest to oldest. You can filter events by metadata, name and value.
Endpoint
GET https://developer-api.oppizi.com/tracking/eventsParameters
startingAfter optional
A cursor used for pagination. You get the value from the response of the previous page.
limit optional
A limit on the number of rooms to be returned. The limit can range between 1 and 100, and defaults to 20.
Minimum: 1
Maximum: 100
Default: 20eventName optional
Name of event(s)
value optional
Value of event(s)
metadata.KEY optional
A filter on metadata. Multiple metadata keys can be used to filter rooms.
metadata.amount=100Example
fetch(
'https://developer-api.oppizi.com/tracking/events?eventName=Purchase&metadata.amount=100',
{
method: 'GET',
headers: new Headers({
'Content-Type': 'application/json',
Authorization: 'Bearer YOUR_SECRET_KEY',
}),
},
);