API Documentation: Vehicles Tracking
GET /api/units/:usdot
This endpoint retrieves live tracking details for vehicles in our network. It provides information such as vehicle location, unit identifier, VIN, and more.
URL
https://app.onroadnetworks.com/api/units/:usdot
Parameters:
- :usdot (required): The USDOT number associated with the units.
Authentication
To access this endpoint, the following headers must be included in the request:
Example
cURL
curl --location --request GET 'https://app.onroadnetworks.com/api/units/:usdot' --header 'x-api-key: ${key}' --header 'provider-token: ${token}'
Response format
JSON
{ "units": [{ "truckNumber": "string", "vin": "string", "coordinates": { "lat": 0.0, "lng": 0.0 }, "timestamp": "string date" }, {...}, {...}] }
Generating API Key
API keys can be generated by following the steps below:
- Click on your profile avatar in the top right corner
- Go to the “Settings” page by clicking on the button in the menu that appears
- Click on the “API Keys” tab
- Click on the “Add key” button and create a new key
Test Data
cURL
curl --location --request GET 'https://app.onroadnetworks.com/api/units/0' --header 'x-api-key: 2b2y38VUi9AWSSUQRn5GD8eKLuKFlORBV7rk-8dCmFTAonRoadELD' --header 'provider-token: 1R8xFqCfchWVnjjQonRoadELD'
Notes
- Ensure that the API key and provider token are kept secure and not exposed in client-side code.
- The response includes all units currently active for the given USDOT number; if no units are active, the “units“ array will be empty.
- All timestamps are in ISO 8601 format.