GET /events/latest/:quantity

Requests the latest event/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 events 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 events for vehicles or drivers from the specified system should be returned.

organisation_id

(optional) *

Indicates that only devices 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.

event_types

(optional) *

A comma separated list of event types indicating which type of events should be returned. For the Fleet Manager system, the word 'video' can be passed indicating that events of any type which resulted in video clips being recorded should be returned. * Required when retrieving data from the Fleet Manager system.

vehicle_ids

(optional)

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

driver_ids

(optional) *

A comma separated list of driver identifiers indicating that only events 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 Event 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) *

event_types

(optional) *

vehicle_ids

(optional)

driver_ids

(optional) *

include_locations

(optional)

callback

(optional)

date_format

(optional)

globalisation

(optional)

Response format

 

Request Examples

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

Response Examples

JSON body:

[{"SystemType":"AssetManagement","VehicleId":"01554cdd-287e-4c0d-8a17-07ae1c372fda","DeviceTimestamp":"\/Date(1317198572000+0000)\/","ReceivedTimestamp":"\/Date(1317198575073+0000)\/","EventType":"37590e5c-0c5b-4119-83d2-9336f97708b2","Value":0,"StartPosition":{"SystemType":"AssetManagement","VehicleId":"01554cdd-287e-4c0d-8a17-07ae1c372fda","DeviceTimestamp":"\/Date(1317198572000+0000)\/","ReceivedTimestamp":"\/Date(1317198574850+0000)\/","IgnitionOn":false,"Odometer":0,"Longitude":-0.1445675,"Latitude":51.44867,"Speed":0,"Heading":0}},
{"SystemType":"AssetManagement","VehicleId":"501926a2-bd03-4ca3-96b9-73684b5293b5","DeviceTimestamp":"\/Date(1317198575000+0000)\/","ReceivedTimestamp":"\/Date(1317198580763+0000)\/","EventType":"80b16f4b-1261-427d-834d-87234c82bec3","Value":0,"StartPosition":{"SystemType":"AssetManagement","VehicleId":"501926a2-bd03-4ca3-96b9-73684b5293b5","DeviceTimestamp":"\/Date(1317198575000+0000)\/","ReceivedTimestamp":"\/Date(1317198580550+0000)\/","DriverId":"5fe0369a-c862-4b98-9d44-d99dd9574b80","IgnitionOn":false,"Odometer":0,"Longitude":-3.661423,"Latitude":58.59499,"Speed":0,"Heading":0}}]

XML body:

<ArrayOfEventResource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<EventResource SystemType="AssetManagement" VehicleId="01554cdd-287e-4c0d-8a17-07ae1c372fda">
		<DeviceTimestamp UtcOffset="0">2011-09-28T08:29:32Z</DeviceTimestamp>
		<ReceivedTimestamp UtcOffset="0">2011-09-28T08:29:35.073Z</ReceivedTimestamp>
		<EventType>37590e5c-0c5b-4119-83d2-9336f97708b2</EventType>
		<Value>0</Value>
		<StartPosition SystemType="AssetManagement" VehicleId="01554cdd-287e-4c0d-8a17-07ae1c372fda">
			<DeviceTimestamp UtcOffset="0">2011-09-28T08:29:32Z</DeviceTimestamp>
			<ReceivedTimestamp UtcOffset="0">2011-09-28T08:29:34.85Z</ReceivedTimestamp>
			<IgnitionOn>false</IgnitionOn>
			<Odometer>0</Odometer>
			<Longitude>-0.14456749</Longitude>
			<Latitude>51.44867</Latitude>
			<Speed>0</Speed>
			<Heading>0</Heading>
		</StartPosition>
	</EventResource>
	<EventResource SystemType="AssetManagement" VehicleId="501926a2-bd03-4ca3-96b9-73684b5293b5">
		<DeviceTimestamp UtcOffset="0">2011-09-28T08:29:35Z</DeviceTimestamp>
		<ReceivedTimestamp UtcOffset="0">2011-09-28T08:29:40.763Z</ReceivedTimestamp>
		<EventType>80b16f4b-1261-427d-834d-87234c82bec3</EventType>
		<Value>0</Value>
		<StartPosition SystemType="AssetManagement" VehicleId="501926a2-bd03-4ca3-96b9-73684b5293b5">
			<DeviceTimestamp UtcOffset="0">2011-09-28T08:29:35Z</DeviceTimestamp>
			<ReceivedTimestamp UtcOffset="0">2011-09-28T08:29:40.55Z</ReceivedTimestamp>
			<DriverId>5fe0369a-c862-4b98-9d44-d99dd9574b80</DriverId>
			<IgnitionOn>false</IgnitionOn>
			<Odometer>0</Odometer>
			<Longitude>-3.66142273</Longitude>
			<Latitude>58.59499</Latitude>
			<Speed>0</Speed>
			<Heading>0</Heading>
		</StartPosition>
	</EventResource>
</ArrayOfEventResource>

CSV body:

SystemType,VehicleId,DeviceTimestamp,ReceivedTimestamp,EventType,DriverId,CoDriverId,Value,StartPosition,EndPosition
AssetManagement,0b29ce0a-1791-4246-8c9b-6c07ea5e7a1f,"2012-07-06T07:09:29Z","2012-07-06T07:08:16.417Z",141539bc-6ec8-411c-87c5-a14f98c7b067,94cbd22a-1247-4105-9f28-5d263f1cf3b9,,0,"{SystemType:AssetManagement,VehicleId:0b29ce0a-1791-4246-8c9b-6c07ea5e7a1f,DeviceTimestamp:2012-07-06T07:09:29Z,ReceivedTimestamp:2012-07-06T07:08:16.407Z,DriverId:94cbd22a-1247-4105-9f28-5d263f1cf3b9,Odometer:231729.3,Longitude:8.716244,Latitude:53.08609,Speed:6,Heading:183,Altitude:11,Hdop:1,Vdop:1,Pdop:1,Satellites:11,Age:2}",
AssetManagement,80e5a680-a965-4796-9ef9-11081c07d503,"2012-07-06T07:08:17Z","2012-07-06T07:08:10.123Z",141539bc-6ec8-411c-87c5-a14f98c7b067,6a53df7d-3ee2-43c0-8b0b-058d470efda6,,0,"{SystemType:AssetManagement,VehicleId:80e5a680-a965-4796-9ef9-11081c07d503,DeviceTimestamp:2012-07-06T07:08:17Z,ReceivedTimestamp:2012-07-06T07:08:10.117Z,DriverId:6a53df7d-3ee2-43c0-8b0b-058d470efda6,Odometer:218237.5,Longitude:7.058708,Latitude:51.33776,Speed:10,Heading:224,Altitude:254,Hdop:1,Vdop:2,Pdop:2,Satellites:10,Age:1}",