GET /positions/latest/:quantity

Requests the latest position/s for vehicles or drivers visible to the authenticated user.

Note: The value of the optional :quantity parameter may not exceed 10 for multiple vehicles/drivers or 100 for a single vehicle/driver or else '413 Request Entity Too Large' will be returned.

Parameters

:quantity

(optional)

The number of positions to return per vehicle or driver (default is 1).

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 positions for vehicles or drivers from the specified system should be returned.

organisation_id

(optional) *

Indicates that only positions 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 positions for the vehicles with the specified identifiers should be returned.

driver_ids

(optional) *

A comma separated list of driver identifiers indicating that only positions for the drivers with the specified identifiers 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 X-Drive system.

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.

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 the requested number of Position 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.

:quantity

(optional)

auth

(required)

system_type

(optional)

organisation_id

(optional) *

vehicle_ids

(optional)

driver_ids

(optional) *

include_locations

(optional)

callback

(optional)

date_format

(optional)

globalisation

(optional)

Response format

 

Request Examples

GET /positions/latest?auth=a78581e7935349c39873812572cda216
GET /positions/latest.xml?auth=a78581e7935349c39873812572cda216
GET /positions/latest.csv?auth=a78581e7935349c39873812572cda216
GET /positions/latest/10?auth=a78581e7935349c39873812572cda216
GET /positions/latest/100?auth=a78581e7935349c39873812572cda216&vehicle_id=8973754b-f084-4ba8-b954-483c6084f607
GET /positions/latest/100?auth=a78581e7935349c39873812572cda216&driver_id=8973754b-f084-4ba8-b954-483c6084f607

Response Examples

JSON body:

[{"SystemType":"AssetManagement","VehicleId":"ae5992b9-3c71-4005-b6d9-4e7f041a313c","DeviceTimestamp":"\/Date(1318424351000+0000)\/","ReceivedTimestamp":"\/Date(1318424356360+0000)\/","Odometer":0.048,"Longitude":18.84112,"Latitude":-33.97892,"Speed":0,"Heading":355,"Altitude":50,"Hdop":1,"Vdop":2,"Pdop":2,"Satellites":8,"Age":0},
{"SystemType":"AssetManagement","VehicleId":"5b2992d2-41a7-494a-b291-cd7cbb3ca25f","DeviceTimestamp":"\/Date(1318424261000+0000)\/","ReceivedTimestamp":"\/Date(1318424273757+0000)\/","Odometer":0,"Longitude":18.84101,"Latitude":-33.97914,"Speed":4294967295,"Heading":0,"Altitude":133,"Hdop":0,"Vdop":1,"Pdop":1,"Satellites":9,"Age":0}]

XML body:

<ArrayOfPosition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Position SystemType="AssetManagement" VehicleId="2943efc3-a7a3-4412-965f-067e3891d90c">
		<DeviceTimestamp UtcOffset="0">2011-10-12T13:01:30Z</DeviceTimestamp>
		<ReceivedTimestamp UtcOffset="0">2011-10-12T13:01:02.463Z</ReceivedTimestamp>
		<Odometer>0</Odometer>
		<Longitude>18.8410149</Longitude>
		<Latitude>-33.9791451</Latitude>
		<Speed>0</Speed>
		<Heading>0</Heading>
		<Altitude>134</Altitude>
		<Hdop>1</Hdop>
		<Vdop>1</Vdop>
		<Pdop>1</Pdop>
		<Satellites>8</Satellites>
		<Age>0</Age>
	</Position>
	<Position SystemType="AssetManagement" VehicleId="4387d8b7-8968-4478-b3ef-85da52ef11a2">
		<DeviceTimestamp UtcOffset="0">2011-10-12T13:01:10Z</DeviceTimestamp>
		<ReceivedTimestamp UtcOffset="0">2011-10-12T13:00:15.18Z</ReceivedTimestamp>
		<Odometer>0</Odometer>
		<Longitude>18.841011</Longitude>
		<Latitude>-33.97914</Latitude>
		<Speed>0</Speed>
		<Heading>0</Heading>
		<Altitude>133</Altitude>
		<Hdop>1</Hdop>
		<Vdop>1</Vdop>
		<Pdop>1</Pdop>
		<Satellites>8</Satellites>
		<Age>0</Age>
	</Position>
</ArrayOfPosition>

CSV body:

SystemType,VehicleId,DeviceTimestamp,ReceivedTimestamp,DriverId,CoDriverId,IgnitionOn,Odometer,Longitude,Latitude,Location,Speed,Heading,Altitude,Hdop,Vdop,Pdop,Satellites,Age
AssetManagement,ec31cce6-001b-4f5e-92cb-7597b2bae1e1,"2012-07-06T07:26:38Z","2012-07-06T07:26:10.29Z",572ace7b-1929-4f6f-8394-fccf56ff4b8e,,,277808.5,7.73834,50.7836,,0,0,181,1,1,1,9,1
AssetManagement,cc0f25d6-d796-403a-bea7-4aca1592d30e,"2012-07-06T07:26:22Z","2012-07-06T07:24:44.253Z",537a8f75-7639-46b0-9bcd-37ba4311903c,,,114241,6.832986,51.21675,,1,302,44,1,1,2,8,3