API Reference
Analytics
Platform analytics and performance tracking
Track Event
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Request Body
application/json
event_name*string
Event name
Length
1 <= length <= 100category?string
Event category
Default
"user_action"Value in
"page_view" | "user_action" | "trading" | "auth" | "error" | "performance" | "feature" | "system"priority?string
Event priority
Default
"medium"Value in
"low" | "medium" | "high" | "critical"properties?
Event properties
timestamp?|
Event timestamp (defaults to server time)
session_id?|
Session identifier
page_url?|
Page URL where event occurred
referrer?|
Referrer URL
user_agent?|
User agent string
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/analytics" \ -H "Content-Type: application/json" \ -d '{ "event_name": "string" }'{
"success": true,
"event_id": "string",
"message": "string",
"timestamp": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Track Batch
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Request Body
application/json
events*array<>
List of events (max 100)
Items
1 <= items <= 100client_id?|
Client identifier
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/analytics/batch" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "event_name": "string" } ] }'{
"success": true,
"events_received": 0,
"events_queued": 0,
"events_failed": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Analytics Stats
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/analytics/stats"{
"total_events": 0,
"events_by_category": {
"property1": 0,
"property2": 0
},
"events_today": 0,
"events_this_hour": 0,
"buffer_status": {
"buffer_size": 0,
"max_buffer_size": 0,
"flush_interval_seconds": 0,
"last_flush": "2019-08-24T14:15:22Z",
"events_pending": 0,
"events_flushed_total": 0
}
}curl -X GET "https://loading/api/v1/analytics/health"{}