Chat with us, powered by LiveChat

Vehicles

Here are the API calls you'll need to be able to add and manage fleet vehicles in your Lorry Route application.

Update Vehicle Position

POST /api/vehicle_position

Description

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

Parameters

Type

Name

Schema

Body

payload
required

VehiclePositionPayload

Payload

Name

Description

Schema

dimensions
required

Example : { "height" : 4.6, "width" : 2.5, "length" : 12, "weight" : 18 }

object

lat
required

Example : 51.509865

number (double)

long
required

Example : -0.118092

number (double)

Responses

HTTP Code

Description

Schema

200

OK

Vehicle_position_r esponse

400

Bad Request

error

422

Unprocessable Entity

error

500

Internal Server Error

error

Example HTTP request

Request body

{
   "dimensions" : {
     "height" : 4.6,
     "width" : 2.5,
     "length" : 12,
     "weight" : 18
   },
   "lat" : 51.509865,
   "long" : -0.118092
}

Example HTTP response

Response 200

{
   "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"
 }

Update Vehicle State

POST /api/vehicle_state

Description

API call where we’ll send a notice if driver is driving / not driving.

Required security scopes: * api:access

Parameters

Type

Name

Schema

Body

payload
required

VehicleStatePayload

Payload

Name

Description

Schema

moving
required

Example : true

boolean

Responses

HTTP Code

Description

Schema

200

OK

VehicleStateRespo nse

400

Bad Request

error

422

Unprocessable Entity

error

500

Internal Server Error

error

Example HTTP request

Request body

{
   "moving" : true
}

Example HTTP response

Response 200

{
   "user_id" : 116,
   "driver_id" : 160,
   "moving" : true
}

List Vehicles

GET /api/vehicles

Description

Lists vehicles with filter limit, offset and registration number.

Required security scopes: * company_account:true

Parameters

Type
Name
Description
Schema
Default
Query
limit
optional
limit for paginate
integer
10
Query
name
optional
query for find vehicles list by name
string
""
Query
offset
optional
offset for paginate
integer
0
Query
order
optional
query to order vehicle group by parameter
string
"name"
Query
orderby
optional
query for sorting vehicle group, desc or asc
string
"asc"
Query
registration_ number
optional
query for find vehicles by registration_number
string
""
Query
vehicle_group_ids
optional
query to find vehicles, list by vehicle group IDs
string
""
Query
vehicle_grou p_name
optional
query to find vehicles, list by vehicle group name
string
""

Responses

HTTP Code

Description

Schema

200

OK

Vehicles

400

Bad Request

error

404

Not Found

error

500

Internal Server Error

error

Example HTTP response

Response 200

{
"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
} }

Show Vehicle

GET /api/vehicles/{vehicleID}

Description

Get a vehicle by ID number.

Required security scopes: * company_account:true

Parameters

Type

Name

Description

Schema

Path

vehicleID required

Vehicle ID

integer

Responses

HTTP Code

Description

Schema

200

OK

Vehicle

400

Bad Request

error

404

Not Found

error

500

Internal Server Error

error

Example HTTP response

Response 200

{
   "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
}

Edit Vehicle

PUT /api/vehicles/{vehicleID}

Description

Edit a Vehicle with vehicleID.

Required security scopes: * company_account:true

Parameters

Type

Name

Description

Schema

Path

vehicleID required

Vehicle ID

integer

Body

payload required

 

VehicleEditPayload

Payload

Name

Description

Schema

height
optional

Example : 1.0

number (double)

length
optional

Example : 1.0

number (double)

name
optional

Length : 3 - 200 Example : "My Car"

string

registration_number
optional

Length : 5 - 200 Example : "123456"

string

vehicle_groups
optional

Example : [ { "id" : 8434208375064080000, "isNew" true, "name" : "Placeat et quiomnis deserunt et." } ]

:

<VehicleGroupPayloa

d > array

vehicle_make
optional

Maximal length : 200 Example : "Toyota"

string

vehicle_type
optional

Maximal length : 200 Example : "Car"

string

weight
optional

Example : 2.0

number (double)

width
optional

Example : 1.0

number (double)

Example HTTP request

Request body

{
   "height" : 1,
   "length" : 1,
   "name" : "My Car",
   "registration_number" : "123456",
   "vehicle_groups" : [ {
     "id" : 8434208375064080000,
     "isNew" : true,
     "name" : "Placeat et qui omnis deserunt et."
   } ],
   "vehicle_make" : "Toyota",
   "vehicle_type" : "Car",
   "weight" : 2,
   "width" : 1
}
Example HTTP response

Response 200

{
   "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
}