Tracktics API
Tracktics API provides comprehensive endpoints for managing sports clubs, teams, players, tracking devices, and training sessions with real-time position data and event markers.
Getting Started
The API follows RESTful principles and returns JSON responses. All timestamps use ISO 8601 format (RFC3339). Base URLs:
- Staging:
https://api.dp.dev.tracktics.systems - WebSocket:
wss://ws.dp.dev.tracktics.systems
Authentication
Most endpoints require JWT authentication via Firebase. Include the token in the Authorization header:
Authorization: Bearer <your-jwt-token>
WebSocket Authentication
WebSocket connections support two authentication methods:
-
Ticket-based (recommended for browsers):
- First, obtain a one-time ticket by calling
POST /ws/ticketwith your Bearer token - Connect to the WebSocket using the ticket ID as a query parameter
- Example:
wss://ws.dp.dev.tracktics.systems?ticket=<ticket_id>&path=/position/clubs/{club_id}
- First, obtain a one-time ticket by calling
-
Direct Bearer token (not supported in browsers):
- Include your Firebase JWT token directly in the
Authorizationheader - Example:
Authorization: Bearer <your-jwt-token>
- Include your Firebase JWT token directly in the
Pagination
List endpoints support cursor-based pagination for optimal performance:
Query Parameters:
limit(optional): Number of items per page. Maximum and default: 100next_token(optional): Cursor token for retrieving the next page of resultsorder(optional): Sort order -desc(newest first, default) orasc(oldest first)from(optional): Filter items created at or after this timestamp (RFC3339 format)until(optional): Filter items created up until this timestamp (RFC3339 format)
Response Headers:
Pagination-Limit: The current page limitPagination-Next-Token: Cursor token for the next page (only present if more data available)
Example:
GET /clubs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/players?limit=50&order=desc
Response Headers:
Pagination-Limit: 50
Pagination-Next-Token: eyJsYXN0X2lkIjoiLi4uIn0=
Next page:
GET /clubs/.../players?limit=50&next_token=eyJsYXN0X2lkIjoiLi4uIn0=
Rate Limiting
Rate limiting is not currently implemented but will be defined in future versions. We recommend implementing client-side rate limiting and exponential backoff for retry logic.
Error Handling
The API uses standard HTTP status codes and returns error details in JSON format:
{
"error": "Resource not found",
"code": "NOT_FOUND"
}
Common status codes:
200OK - Request succeeded201Created - Resource created successfully204No Content - Request succeeded with no response body400Bad Request - Invalid request parameters or body401Unauthorized - Missing or invalid authentication token403Forbidden - Insufficient permissions for the requested operation404Not Found - Resource does not exist409Conflict - Resource conflict (e.g., revision mismatch)500Internal Server Error - Server-side error
Authentication
- HTTP: Bearer Auth
Firebase JWT authentication token
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Bearer format: | JWT |