GET /events/summary/:from/:to

Requests event summary data for vehicles visible to the authenticated user summarising events which occurred between the specified :from and :to parameters.

Note: This call is not available for the Asset Management and X-Drive systems. The time range may not exceed 7 days or else '413 Request Entity Too Large' will be returned.

Parameters

:from

(required)

Indicates that only events generated on or after this date and time should be returned. Pass a date/time as seconds since 1970 or a date/time string in the format YYYYMMDDHHmmss. If the authenticated user's globalisation preferences (see GET account/profile) are passed with this request, the value passed in this parameter should be in the time zone specified by the globalisation preferences. Otherwise the value passed should be UTC.

:to

(required)

Indicates that only events generated on or before this date and time should be returned.

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.

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

(required)

A comma separated list of event types indicating which type of events should be returned. The word 'video' can be passed indicating that events of any type which resulted in video clips being recorded should be returned.

vehicle_ids

(optional)

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

summary_type

(optional)

The word ‘totals’ or ‘daily’ indicating how to summarise the data. ‘totals’ will return one summary resource per vehicle per event type for the specified period. ‘daily’ will return one summary resource per vehicle per event type per day. Defaults to ‘totals’.

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 list of EventSummary 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.

:from

(required)

:to

(required)

auth

(required)

organisation_id

(optional) *

event_types

(required)

vehicle_ids

(optional)

summary_type

(optional)

callback

(optional)

date_format

(optional)

globalisation

(optional)

Response format

 

Request Examples

GET /events/summary/20110101000000/20110102000000?auth=a78581e7935349c39873812572cda216&event_types=1,2
GET /events/summary/20110101000000/20110102000000.xml?auth=a78581e7935349c39873812572cda216&event_types=1,2
GET /events/summary/20110101000000/20110102000000.json?auth=a78581e7935349c39873812572cda216&event_types=1,2
GET /events/summary/20110101000000/20110102000000?auth=a78581e7935349c39873812572cda216&event_types=video

Response Examples

JSON body:

[{"SystemType":"FM","VehicleId":"152","Date":"\/Date(1349128800000+0200)\/","EventType":"1","EventCount":5}]

XML body:

<ArrayOfEventSummary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<EventSummary SystemType="FM" VehicleId="152">
		<Date>2012-10-02T00:00:00</Date>
		<EventType>1</EventType>
		<EventCount>5</EventCount>
	</EventSummary>
</ArrayOfEventSummary>

CSV body:

SystemType,VehicleId,Date,EventType,EventCount
FM,152,2012-10-02,1,5