get_routes_history
To get the history of routes, use the order/get_routes_history method.
To use the method, you need the Request reports and messages access right to the resource.
Endpoint
svc=order/get_routes_history¶ms={
"itemId":<long>,
"ivalType":<int>,
"ivalFrom":<uint>,
"ivalTo":<uint>,
"name":"<text>",
"unitId":<long>,
"routeId":<long>
}
Parameters
The required parameters are marked with an asterisk (*).
| Parameter | Default value | Description |
|---|---|---|
itemId* |
Resource ID. | |
ivalType |
1 |
Interval selection method. The values are the same as for the ivalType parameter of events/load, with ivalFrom and ivalTo used instead of timeFrom and timeTo. |
ivalFrom |
0 |
Depends on ivalType: interval start (UNIX time) or the number of routes to load. |
ivalTo |
UINT_MAX |
Interval end (UNIX time). |
name |
Route name masks separated by commas. A route is returned if its name matches at least one mask. Use * for any number of characters, ? for exactly one character, and ! at the beginning of a mask to invert it. For example, "Vil*,Berl*" returns the routes whose names start with Vil or Berl, "*kr" returns the routes whose names end with kr, and "!Vil*" returns the routes whose names don’t start with Vil. |
|
unitId |
Unit ID. | |
routeId |
Unique route ID (the uid property of the route). |
Response
If the request is completed successfully, the response is returned in the following format:
{
"routes":[
{...},
{...},
...
],
"count":<uint>, /* number of the filtered routes (size of "routes") */
"total":<uint> /* total number of routes for the requested period */
}
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters. |
| 6 | Failed to load the history, for example, because the ivalType value is invalid. |
| 7 | The resource doesn’t exist, or the user doesn’t have the Request reports and messages access right to it. |