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": <uint>,  /* Message index */
			"t": <uint>,  /* Time */
			"p": {        /* Location */
				"y": <double>,  /* Latitude */
				"x": <double>   /* Longitude */
			}
		},
		"to": { /* Ending point of the trip */
			"i": <uint>,  /* Message index */
			"t": <uint>,  /* 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
4 Invalid item ID or input format.
6 Failed to fetch unit messages.
7 The user doesn’t have the Request reports and messages access right to the unit.

If you find a mistake in the text, please select it and press Ctrl+Enter.