Here are the API calls you'll need to be able to add and manage fleet vehicles in your Lorry Route application.
POST /api/vehicle_position
An API call which sends the vehicle position coordinates. Any restrictions data will be sent back. In addition, the driver will get a soft push notification, according to the push token, if any restrictions are found. The driver will get a hard notification if the payload includes Vehicle Dimensions and restrictions are applied to those vehicle dimensions.
Note: By providing Vehicle Dimensions, the vehicle with those dimensions will be assigned to the driver.
Required security scopes: * api:access
{
"dimensions" : {
"height" : 4.6,
"width" : 2.5,
"length" : 12,
"weight" : 18
},
"lat" : 51.509865,
"long" : -0.118092
}
{
"restrictions" : [ {
"info" : "",
"lat" : 53.40521,
"lon" : -2.99391,
"maximum" : 3.5,
"postcode" : "L2 0",
"street" : "QUEENSWAY TUNNEL",
"type" : 30
}, {
"info" : "",
"lat" : 53.40521,
"lon" : -2.99391,
"maximum" : 3.9,
"postcode" : "L2 0",
"street" : "QUEENSWAY TUNNEL",
"type" : 40
} ],
"code" : "found"
}
POST /api/vehicle_state
API call where we’ll send a notice if driver is driving / not driving.
Required security scopes: * api:access
{
"moving" : true
}
{
"user_id" : 116,
"driver_id" : 160,
"moving" : true
}
GET /api/vehicles
Lists vehicles with filter limit, offset and registration number.
Required security scopes: * company_account:true
{
"data" : [ {
"height" : 0.42797988832373546,
"id" : 1207023320870864600,
"length" : 0.5673346808593535,
"name" : "Laboriosam atque modi velit iure ea qui.",
"registration_number" : "Explicabo officia dignissimos voluptatem quia.",
"vehicle_groups" : [ {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
} ],
"vehicle_make" : "Illo sed.",
"vehicle_type" : "Beatae ullam rerum.",
"weight" : 0.2613678297106885,
"width" : 0.7858617175267627
}, {
"height" : 0.42797988832373546,
"id" : 1207023320870864600,
"length" : 0.5673346808593535,
"name" : "Laboriosam atque modi velit iure ea qui.",
"registration_number" : "Explicabo officia dignissimos voluptatem quia.",
"vehicle_groups" : [ {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
} ],
"vehicle_make" : "Illo sed.",
"vehicle_type" : "Beatae ullam rerum.",
"weight" : 0.2613678297106885,
"width" : 0.7858617175267627
}, {
"height" : 0.42797988832373546,
"id" : 1207023320870864600,
"length" : 0.5673346808593535,
"name" : "Laboriosam atque modi velit iure ea qui.",
"registration_number" : "Explicabo officia dignissimos voluptatem quia.",
"vehicle_groups" : [ {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
} ],
"vehicle_make" : "Illo sed.",
"vehicle_type" : "Beatae ullam rerum.",
"weight" : 0.2613678297106885,
"width" : 0.7858617175267627
} ],
"paginate" : {
"current_page" : 3563526782017826000,
"total_item" : 1844667182292352300,
"total_page" : 5530544724904183000
} }
GET /api/vehicles/{vehicleID}
Get a vehicle by ID number.
Required security scopes: * company_account:true
{
"height" : 0.42797988832373546,
"id" : 1207023320870864600,
"length" : 0.5673346808593535,
"name" : "Laboriosam atque modi velit iure ea qui.",
"registration_number" : "Explicabo officia dignissimos voluptatem quia.",
"vehicle_groups" : [ {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
} ],
"vehicle_make" : "Illo sed.",
"vehicle_type" : "Beatae ullam rerum.",
"weight" : 0.2613678297106885,
"width" : 0.7858617175267627
}
PUT /api/vehicles/{vehicleID}
Edit a Vehicle with vehicleID.
Required security scopes: * company_account:true
{
"height" : 0.42797988832373546,
"id" : 1207023320870864600,
"length" : 0.5673346808593535,
"name" : "Laboriosam atque modi velit iure ea qui.",
"registration_number" : "Explicabo officia dignissimos voluptatem quia.",
"vehicle_groups" : [ {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
}, {
"count" : 6620848348023044000,
"id" : 3064264591878618000,
"name" : "Non id.",
"user_id" : 749351829295412000
} ],
"vehicle_make" : "Illo sed.",
"vehicle_type" : "Beatae ullam rerum.",
"weight" : 0.2613678297106885,
"width" : 0.7858617175267627
}