GET /vehicles

Requests the details of vehicles visible to the authenticated user.

Parameters

auth

(required)

The authentication token received in response to the call to POST authentication_credentials or GET authentication_token. Applications should pass the authentication token in the custom "X-auth" HTTP header to avoid passing it in in the query string.

system_type

(optional)

Indicates that only vehicles from the specified system should be returned.

organisation_id

(optional) *

Indicates that only vehicles belonging to the specified organisation should be returned. * Required when retrieving data from the Fleet Manager system. Ignored when retrieving data from the X-Drive system.

vehicle_ids

(optional)

A comma separated list of vehicle identifiers indicating that only vehicles with the specified identifiers should be returned.

site_id

(optional) *

Indicates that only vehicles belonging to the specified site should be returned. NOTE: This parameter cannot be used in conjunction with the vehicle_ids parameter and will be ignored if both are passed. * Ignored when retrieving data from the Asset Management or X-Drive system.

with_video

(optional) *

Indicates that only vehicles equipped with a video recoding device should be returned. * Ignored when retrieving data from the Asset Management or X-Drive system.

include_positions

(optional)

Indicates whether or not to include the last known position of each vehicle that is returned. Passing a value of 1, t, or true will result in positions being included.

include_locations

(optional)

Indicates whether or not to include locations/addesses resolved by reverse-geocoding for the positions that are returned. Passing a value of 1, t, or true will result in locations being included. NOTE: Including locations is substantially slower, and should only be done when absolutely necessary! Where possible, applications should call GET geocoding/location or POST geocoding/coordinates to retrieve locations/addresses when required.

include_associated

(optional) *

Indicates whether or not to include the driver associated with each vehicle that is returned. Passing a value of 1, t, or true will result in the associated driver being included. NOTE: This parameter can only be used in conjunction with the include_positions parameter. * Ignored when retrieving data from the X-Drive system.

callback

(optional)

Only available for JSON format. If supplied, the response will use JSONP format with a callback of the given name.

date_format

(optional)

Only available for JSON format. If supplied, the response will contain JSON dates serialized in the specified format. 0 = Timestamp with offset e.g. "\/Date(1346080140000+0500)\/". 2 = ISO8601 e.g. "2012-08-27T15:09:00.0000000+05:00". Applications may pass this parameter in the custom "X-DateFormat" custom HTTP header instead of this query parameter.

globalisation

(optional)

The authenticated user's globalisation preferences as received in response to the call to GET account/profile or in the custom "X-Globalisation" HTTP header returned in response to authenticated calls. Applications should pass this back to the server with every call, either in this parameter, or in the the custom "X-Globalisation" HTTP header if automatic conversion of values is required.

Request Content Type

N/A

Response

Returns a collection of one or more Vehicle resources in the requested format.

Response Content Type

application/json, application/javascript (JSONP), application/xml or text/csv as requested

Give It A Try...

Enter appropriate parameter values then click on the link which appears to try the API call...

Note: You must have JavaScript support enabled in your browser to use this feature.

auth

(required)

system_type

(optional)

organisation_id

(optional) *

vehicle_ids

(optional)

site_id

(optional) *

with_video

(optional) *

include_positions

(optional)

include_locations

(optional)

include_associated

(optional) *

callback

(optional)

date_format

(optional)

globalisation

(optional)

Response format

 

Request Examples

GET /vehicles?auth=e722fa0c702f42b68e2fdb771a80caed
GET /vehicles.json?auth=e722fa0c702f42b68e2fdb771a80caed
GET /vehicles.xml?auth=e722fa0c702f42b68e2fdb771a80caed
GET /vehicles.csv?auth=e722fa0c702f42b68e2fdb771a80caed
GET /vehicles?auth=e722fa0c702f42b68e2fdb771a80caed&system_type=AssetManagement

Response Examples

JSON body:

[{"SystemType":"AssetManagement","VehicleId":"fc7f23e1-0f49-4b9a-a8ef-fba4a115ca07","RegistrationNumber":"VRN_1342298","Description":"Carlo Ford Laser","InstalledDeviceType":"FM5000Series","InstalledDeviceId":"4a2831ee-6844-4247-9407-5240d332df6b"},
{"SystemType":"AssetManagement","VehicleId":"bf200c51-5506-4fa3-a64c-65823f1b4e78","RegistrationNumber":"VRN_1342298","Description":"Gideon Audi A4","InstalledDeviceType":"FM5000Series","InstalledDeviceId":"e481099f-10ce-4e34-97d8-626f914d8280"}]

XML body:

<ArrayOfVehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Vehicle SystemType="AssetManagement" VehicleId="fc7f23e1-0f49-4b9a-a8ef-fba4a115ca07">
		<RegistrationNumber>VRN_1342298</RegistrationNumber>
		<Description>Carlo Ford Laser</Description>
		<InstalledDeviceType>FM5000Series</InstalledDeviceType>
		<InstalledDeviceId>4a2831ee-6844-4247-9407-5240d332df6b</InstalledDeviceId>
	</Vehicle>
	<Vehicle SystemType="AssetManagement" VehicleId="bf200c51-5506-4fa3-a64c-65823f1b4e78">
		<RegistrationNumber>VRN_1342298</RegistrationNumber>
		<Description>Gideon Audi A4</Description>
		<InstalledDeviceType>FM5000Series</InstalledDeviceType>
		<InstalledDeviceId>e481099f-10ce-4e34-97d8-626f914d8280</InstalledDeviceId>
	</Vehicle>
</ArrayOfVehicle>

CSV body:

SystemType,VehicleId,OrganisationId,SiteId,RegistrationNumber,Description,VinOrChassisNumber,InstalledDeviceType,InstalledDeviceId,IconName,LatestPosition,AssociatedDriver
AssetManagement,2c45d292-80fc-497f-9093-a8e496fad524,29b66708-c14d-464b-a416-2a2f4950b8ce,,AK-UB 303,AK-UB 10,,FM5000Series,7f902dee-b009-458d-a079-163e1e1752a8,,,
AssetManagement,26a64e72-a689-485d-8786-48b4db2d7972,29b66708-c14d-464b-a416-2a2f4950b8ce,,AK-UB 120,AK-UB 120,,FM5000Series,532e27c5-9d88-467c-94ec-d82107430424,,,