Skip to content

Analytics

This document provides detailed information about the Analytics API endpoints.

Base URL

  • Base path /api2/analytics

Authorization

  • Requires Cookie: JSESSIONID=session_id

Device Alerts Analytics

Fetches alerts analytics data for specified devices.

🛠 Endpoint:

GET /device/alerts

Query Parameters:

Parameter Type Required Description
deviceId String[] Yes Array of device IDs
from String Yes Start date-time (ISO format)
to String Yes End date-time (ISO format)

cURL Example:

curl -X GET \
  'https://api.trackongps.com/api2/analytics/device/alerts?deviceId=123&deviceId=456&from=2024-01-01T00:00:00Z&to=2024-01-02T00:00:00Z' \
  -H 'Cookie: JSESSIONID=session_id'
200 OK - Response Body
{
  "total": 50,
 "timeData": {
   "2024-01-01": 30,
   "2024-01-02": 20
  },
  "alarms": {
    "overSpeed": 25,
    "doorOpen": 15,
   "geofence": 10
 },
 "vehicleData": [
    {
      "deviceId": "123",
      "alarms": {
        "overSpeed": 15,
       "doorOpen": 5
     },
     "timeData": {
        "2024-01-01": 10,
        "2024-01-02": 10
      },
      "total": 20
   }
  ]
}

Payment Analytics

Retrieves payment analytics overview for the authenticated user.

🛠 Endpoint:

GET /payment/overview

cURL Example:

curl -X GET \
  'https://api.trackongps.com/api2/analytics/payment/overview' \
  -H 'Cookie: JSESSIONID=session_id'
200 OK - Response Body
{
  "transactionsCount": 25,
  "totalAmount": 66625.3,
  "completedAmount": 30,
  "pendingAmount": 66595.3,
  "savedAmount": 200,
  "pendingCount": 22,
  "failedCount": 0,
  "completedCount": 3,
  "methods": [
    {
      "method": "esewa",
      "transactionsCount": 16,
      "totalAmount": 40001,
      "pendingAmount": 39971,
      "completedAmount": 30,
      "pendingCount": 13,
      "completedCount": 3,
      "failedCount": 0,
      "savedAmount": 200
    }
  ]
}