Vehicles
Fields
Field | Type | Description | Example |
---|---|---|---|
id | string | Vehicle ID | 5iUGSh6f3jnFaCYegp20HD |
licensePlate | string | License plate | YOUR-LICENSE-PLATE |
gpsId | string | Identifier for GPS devices | MYGPSID |
active | bool | Whether or not the vehicle is active | true |
gpsIcon | string | An icon to be used when displaying the vehicle on the map | default |
gpsDistanceMethod | string | Used for determining how to compute GPS distances | auto |
gpsKeepAliveInterval | int | How long to wait (in seconds) until considering that the vehicle lost the GPS signal | 3600 |
driver | User | The driver | {"id": "..."} |
zones | list |
List of zones that this vehicle is assigned to | [{"id": "..."}, ...] |
team | Team | Team that this vehicle is assigned to | {"id": "..."} |
cost | VehicleCost | Cost configuration assigned to the vehicle | {"id": "..."} |
schedule | list |
Work schedule | [{"id": "..."}] |
files | list |
Attachments | [{"id": "..."}] |
maxWeight | int | Max weight capacity in kg. | 1000 |
maxPallets | decimal | Max pallets capacity | 5.0 |
maxVolume | decimal | Max volume capacity in m3 | 15.0 |
skills | list |
List of skills that this vehicle has. The same skills can be attached to clients. | [{"id": "..."}, ...] |
garageLocation | LatLon | Garage location (lat and lon object) | {"lat": ..., "lon": ...} |
Create a new vehicle
curl \
-X POST \
-H 'Authorization: Token ...' \
-H 'Content-Type: application/json' \
-d '{"licensePlate": "MY-FIRST-VEHICLE"}' \
https://app.xfleet.io/api/v1/companies/{company}/vehicles
{
"licensePlate": "MY-FIRST-VEHICLE",
"active": true,
"gpsDistanceMethod": "auto",
"id": "5iUGSh6f3jnFaCYegp20HD",
"createdAt": "2021-11-06T21:52:09+00:00",
"createdBy": {
"id": "5UDdBUlZfOJKPrF7puVNRI"
}
}
List vehicles
$ curl -H 'Authorization: Token ...' \
-X GET \
https://app.xfleet.io/api/v1/companies/{company}/vehicles
[
{
"licensePlate": "MY-FIRST-VEHICLE",
"active": true,
"gpsDistanceMethod": "auto",
"id": "5iUGSh6f3jnFaCYegp20HD",
"createdAt": "2021-11-06T21:52:09+00:00",
"createdBy": {
"id": "5UDdBUlZfOJKPrF7puVNRI"
}
}
]
Update a vehicle
This performs partial updates on a given vehicle.
curl \
-X POST \
-H 'Authorization: Token ...' \
-H 'Content-Type: application/json' \
-d '{"licensePlate": "THE NEW LICENSE PLATE"}' \
https://app.xfleet.io/api/v1/companies/{company}/vehicles/{id}
{
"licensePlate": "THE NEW LICENSE PLATE",
"active": true,
"gpsDistanceMethod": "auto",
"id": "5iUGSh6f3jnFaCYegp20HD",
"createdAt": "2021-11-06T21:52:09+00:00",
"createdBy": {
"id": "5UDdBUlZfOJKPrF7puVNRI"
}
}