export_messages

To export messages (loaded to a layer or directly) to a file, use the exchange/export_messages command.

Copied!
svc=exchange/export_messages&params={"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:

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 itemIdtimeFromtimeToformat 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 temIdtimeFromtimeToformat 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 itemIdtimeFromtimeToformat and compress fields; the second one requires the layerNameformat and compress fields.

If the request wasn’t completed successfully, an error code is returned.

Error codes

CodeDescription
1Invalid or obsolete request SID.
4

One of the following errors:

  • error validating parameters,
  • layer not found,
  • failed to save messages to the temporary file.
6

One of the following errors:

  • failed to fetch the user,
  • failed to fetch the renderer,
  • compression-related problems.
7

One of the following errors:

  • unit not found,
  • failed to fetch the unit with the required access rights (for the first mode, it is ADF_ACL_ITEM_EXECUTE_REPORTS, for the second mode, it is ADF_ACL_AVL_UNIT_EXPORT_MSGS).
1001The unit has no messages within the specified time interval, or any messages at all.
Download PDF file
Download Word document

See also