{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Fleet Tracking & Monitoring","description":"The operational transportation management API. Full access to planning, tracking, invoicing, and integrations — built on the OTM5 open data standard.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"fleet-tracking--monitoring","__idx":0},"children":["Fleet Tracking & Monitoring"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"objective","__idx":1},"children":["Objective"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up real-time tracking for your fleet — monitor vehicle positions, sensor data, and trip progress."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-register-vehicles","__idx":2},"children":["Step 1: Register Vehicles"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create vehicle records for your fleet:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/vehicle \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"name\": \"Truck NL-AB-12\",\n    \"licensePlate\": \"NL-AB-12\",\n    \"type\": \"truck\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-add-sensors","__idx":3},"children":["Step 2: Add Sensors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Attach sensors for temperature, fuel level, or other IoT data:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/sensor \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"name\": \"Temperature - Cargo bay\",\n    \"type\": \"temperature\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-create-location-update-events","__idx":4},"children":["Step 3: Create Location Update Events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["As GPS data comes in, create location update events:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/event \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"type\": \"LocationUpdateEvent\",\n    \"dateTime\": \"2026-03-22T14:30:00Z\",\n    \"lifeCycle\": \"actual\",\n    \"geoReference\": {\n      \"lat\": 52.3676,\n      \"lng\": 4.9041\n    }\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-record-arrival-and-departure-events","__idx":5},"children":["Step 4: Record Arrival and Departure Events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Track when vehicles arrive at and depart from locations:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Arrival\ncurl -X POST https://api.otms.transportial.com/api/event \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"type\": \"ArrivalEvent\",\n    \"dateTime\": \"2026-03-22T14:35:00Z\",\n    \"lifeCycle\": \"actual\"\n  }'\n\n# Departure\ncurl -X POST https://api.otms.transportial.com/api/event \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"type\": \"DepartureEvent\",\n    \"dateTime\": \"2026-03-22T15:10:00Z\",\n    \"lifeCycle\": \"actual\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-5-monitor-sensor-data","__idx":6},"children":["Step 5: Monitor Sensor Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Read sensor values at a specific point in time:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/sensor/{sensorId}/value/2026-03-22T14:30:00Z\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Get sensor updates over a time range:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/sensors/{sensorId}/updates/2026-03-22T00:00:00Z/2026-03-22T23:59:59Z\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-6-get-vehicle-trip-history","__idx":7},"children":["Step 6: Get Vehicle Trip History"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["View what trips a vehicle has been on:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# All trips for a vehicle\ncurl -X GET \"https://api.otms.transportial.com/api/vehicle/{vehicleId}/trips/0/20\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n\n# Trips within a date range\ncurl -X GET \"https://api.otms.transportial.com/api/vehicle/{vehicleId}/trips:byDate/2026-03-01/2026-03-31\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-7-fleet-wide-analytics","__idx":8},"children":["Step 7: Fleet-Wide Analytics"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Get insights across your entire fleet:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Fleet trip report\ncurl -X GET \"https://api.otms.transportial.com/api/insights/fleet/{fleetId}/trips/2026-03-01/2026-03-31\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n\n# Move actions report\ncurl -X GET \"https://api.otms.transportial.com/api/insights/fleet/{fleetId}/moveActions/2026-03-01/2026-03-31\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n\n# CO2 emissions\ncurl -X POST \"https://api.otms.transportial.com/api/insights/vehicles/CO2:byDateRange\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"vehicleIds\": [\"vehicle-uuid-1\", \"vehicle-uuid-2\"],\n    \"startDate\": \"2026-03-01\",\n    \"endDate\": \"2026-03-31\"\n  }'\n\n# Sensor values across vehicles\ncurl -X POST \"https://api.otms.transportial.com/api/insights/vehicles/sensorValueAtDate\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"vehicleIds\": [\"vehicle-uuid-1\", \"vehicle-uuid-2\"],\n    \"date\": \"2026-03-22T14:00:00Z\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-8-set-up-alerts","__idx":9},"children":["Step 8: Set Up Alerts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create alerts for when conditions are met (e.g., temperature out of range):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/alert \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"name\": \"Cold chain temperature alert\",\n    \"type\": \"sensor_threshold\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"event-types-for-tracking","__idx":10},"children":["Event Types for Tracking"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Event"},"children":["Event"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Use Case"},"children":["Use Case"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ArrivalEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vehicle arrives at a geofenced location"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DepartureEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vehicle leaves a location"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GateInEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vehicle enters a facility"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GateOutEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vehicle exits a facility"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["StartMovingEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vehicle starts driving"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["StopMovingEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vehicle stops"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["StartEngineEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Engine on"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["StopEngineEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Engine off"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SensorUpdateEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Temperature, fuel, weight, etc."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"key-takeaways","__idx":11},"children":["Key Takeaways"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Events create the real-time tracking data layer"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Sensors provide IoT data (temperature, fuel, humidity)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fleet insights give aggregated analytics across vehicles"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Date-range queries let you analyze historical patterns"]}]}]},"headings":[{"value":"Fleet Tracking & Monitoring","id":"fleet-tracking--monitoring","depth":1},{"value":"Objective","id":"objective","depth":2},{"value":"Step 1: Register Vehicles","id":"step-1-register-vehicles","depth":2},{"value":"Step 2: Add Sensors","id":"step-2-add-sensors","depth":2},{"value":"Step 3: Create Location Update Events","id":"step-3-create-location-update-events","depth":2},{"value":"Step 4: Record Arrival and Departure Events","id":"step-4-record-arrival-and-departure-events","depth":2},{"value":"Step 5: Monitor Sensor Data","id":"step-5-monitor-sensor-data","depth":2},{"value":"Step 6: Get Vehicle Trip History","id":"step-6-get-vehicle-trip-history","depth":2},{"value":"Step 7: Fleet-Wide Analytics","id":"step-7-fleet-wide-analytics","depth":2},{"value":"Step 8: Set Up Alerts","id":"step-8-set-up-alerts","depth":2},{"value":"Event Types for Tracking","id":"event-types-for-tracking","depth":2},{"value":"Key Takeaways","id":"key-takeaways","depth":2}],"frontmatter":{"seo":{"title":"Fleet Tracking & Monitoring"}},"lastModified":"2026-03-22T21:04:26.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/examples/fleet-tracking","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}