External Integration
Fuel Monitoring
Returns fuel monitoring data for a single unit: fuel, DEF and oil levels, plus engine hours. The unit is found by company USDOT and vehicle VIN.
Endpoint
GET/api/externalservice/fuel-monitoring/:usdot/:vin
Authentication Headers
| Header | Value |
|---|---|
x-api-key | Your API key |
provider-token | Your provider token. How to get it |
Path Parameters
| Parameter | Required | Description |
|---|---|---|
usdot | Yes | Company USDOT number. Must belong to the company that owns the API key. |
vin | Yes | Vehicle Identification Number (17 characters) |
Example Request
bash
Response 200 OK
json
{
"unit": {
"truck_number": "101",
"fuelLevelPercent": 64,
"defLevelPercent": 80,
"oilLevelPercent": 92,
"engine_hours": 12345.6
}
}Response Fields
| Field | Type | Description |
|---|---|---|
truck_number | string | Assigned truck number |
fuelLevelPercent | number | null | Fuel level, in percent |
defLevelPercent | number | null | Diesel exhaust fluid (DEF) level, in percent |
oilLevelPercent | number | null | Oil level, in percent |
engine_hours | number | null | Total engine hours from the latest tracking |
Error Responses
| When | Response |
|---|---|
x-api-key or provider-token header is missing | 400 |
provider-token is invalid | Provider token not found. |
| USDOT belongs to a different company than the API key | Don`t have access to company |
| No unit with this VIN, or integration sending is disabled for the unit | Unit not found with this <vin>! |
Notes
- Fuel, DEF and oil levels come from the unit's latest truck info, the same source as the dashboard Fuel Monitoring page.
- Engine hours come from the latest tracking, taken from the ELD first, otherwise from the driver or co-driver.
- If a value is not available (for example, the unit has no truck info or tracking yet), the field is returned as
null.
API Key Generation
Keys are created via the company's main dashboard account. Navigate to the sidebar → "More" section → API Keys page. See the full guide: How to Create an API Key.