load_interval
To load messages for a certain interval, use the command messages/load_interval:
svc=messages/load_interval¶ms={"itemId":<long>,
"timeFrom":<uint>,
"timeTo":<uint>,
"flags":<uint>,
"flagsMask":<uint>,
"loadCount":<uint>}
This request can’t be executed simultaneously with the following requests:
- …/report/exec_report,
- …/report/export_result,
- …/report/get_result_chart,
- …/report/get_result_map,
- …/render/create_messages_layer,
- …/unit/get_trips,
- …/resource/get_driver_bindings,
- …/resource/get_trailer_bindings,
- all requests from the section exchange,
- …/account/get_account_history.
You can find an example of the load_interval request in the sample messages.
Parameters
The required parameters are marked with an asterisk (*).
Name | Description |
---|---|
itemId* | Unit or resource ID (depends on the type of message you want to get). |
timeFrom* | Interval beginning. |
timeTo* | Interval end. |
flags* | Flags for loading messages. See the description below. |
flagsMask* | Mask. See the description below. |
loadCount* | Number of messages to return (0xffffffff means all the found ones). |
Examples of using masks and flags:
Mask | Flag | Result |
---|---|---|
0xFF00 | 0x0000 | All data messages. |
0xFF10 | 0x0010 | Data messages which contain the alarm bit (0x10). |
0xFFF0 | 0x0010 | Data messages which contain the alarm bit (0x10), but don't contain information about the driver code (0x20). |
0xFFF2 | 0x0022 | Data messages which contain information about the driver code (0x20) and input data information (0x02), but don't contain the alarm bit (0x10). |
0xFF01 | 0x0601 | Events regarded as violations. |
Response
If the request is completed successfully, the response is as follows:
{
"count":<uint>, /* number of messages */
"messages":[ /* array of messages */
{
...
}
]
}
You can find message formats, masks and flags here.
If the request is not completed successfully, an error code is returned.
Error codes
Error code | Description |
---|---|
7 | Failed to fetch the message manager. |
6 | Failed to fetch messages for the interval. |
4 | Failed to get the current user. |
1003 | Accept-encoding is not gzip. |