export_messages
To export messages (loaded to a layer or directly) to a file, use the exchange/export_messages command.
svc=exchange/export_messages¶ms={"layerName":<text>,
"format":<text>,
"itemId":<long>,
"timeFrom":<uint>,
"timeTo":<uint>,
"compress":<bool>}
This request can’t be executed simultaneously with any request from this chapter and the following requests:
- …/report/exec_report,
- …/report/export_result,
- …/report/get_result_chart,
- …/report/get_result_map,
- …/messages/load_interval,
- …/render/create_messages_layer,
- …/unit/get_trips,
- …/resource/get_driver_bindings,
- …/resource/get_trailer_bindings,
- …/account/get_account_history.
Parameters
The required parameters are marked with an asterisk (*).
Name | Description |
layerName | Message layer name. Specify it to export messages from a layer. |
itemId | Unit identifier in the system. Specify it to export messages directly. |
format* | File format: txt, kml, plt, wln, wlb. |
timeFrom | Start of the interval. Specify it to export messages directly. |
timeTo | End of the interval. Specify it to export messages directly. |
compress* | Specify 1 to compress the file, or 0 to get the uncompressed file. |
Response
Returns a file of the specified format.
If the request parameters have the itemId, timeFrom, timeTo, format and compress fields, the unit is obtained by the value of the itemId field and then the unit messages from timeFrom to timeTo are returned. The layerName field is ignored in this case, even if it is specified in the request. Otherwise (if at least one of the temId, timeFrom, timeTo, format and compress fields is missing), the layer is obtained by the value of the layerName field; after that, the unit is obtained from the layer and all the unit messages are returned (in this case the timeFrom and timeTo fields are ignored). In other words, the command operates in two modes. The first one requires the itemId, timeFrom, timeTo, format and compress fields; the second one requires the layerName, format and compress fields.
If the request wasn’t completed successfully, an error code is returned.
Error codes
Code | Description |
1 | Invalid or obsolete request SID. |
4 | One of the following errors:
|
6 | One of the following errors:
|
7 | One of the following errors:
|
1001 | The unit has no messages within the specified time interval, or any messages at all. |