get_trips

To get information about trips for a specified period, upload unit messages and execute the unit/get_trips command.

Copied!
svc=unit/get_trips&params={"itemId":<long>,			   
			   			   "msgsSource":<text>,
                           "timeFrom":<uint>,
                           "timeTo":<uint>}

This request can’t be executed simultaneously with the following requests:

Parameters

Name

Description

itemId

Unit ID.

timeFrom

Interval beginning.

timeTo

Interval end.

msgsSource

Message layer name (only one layer is available).
Specify 1 to use the message loader.

Response

If the request is completed successfully, the response contains information about trips.

Copied!
[
	{
		"from": { /* Starting point of the trip */
			"i": <unit>,  /* Message index */
			"t": <unit>,  /* Time */
			"p": {        /* Location */
				"y": <double>,  /* Latitude */
				"x": <double>   /* Longitude */
			}
		},
		"to": { /* Ending point of the trip */
			"i": <unit>,  /* Message index */
			"t": <unit>,  /* Time */
			"p": {        /* Location */
				"y": <double>,  /* Latitude */
				"x": <double>   /* Longitude */
			}
		},
		"m": <double> /* Mileage (meters) */
	}
]

If the request fails, an error code is returned.

Error codes

Code

Description

4Invalid item ID or input format.
6Failed to fetch unit messages.
7The user doesn't have the required access rights to the unit (ADF_ACL_ITEM_EXECUTE_REPORTS).
Download PDF file
Download Word document

See also