load

To load events for a specified period into the session for later processing, use the events/load request.

Copied!
svc=events/load&params={"itemId":<long>,
            "ivalType":<int>,
            "timeFrom":<uint>,
            "timeTo":<uint>,
            "detectors":[
                {
                    "type":<text>,
                    "filter1":<uint>
                },
                ...
            ]}

Parameters

Parameter Description
itemId Unit ID.
ivalType Algorithm type (see below).
timeFrom Interval beginning (UNIX time) if 1, 4, 5 or 6 is specified in ivalType.
Number of requested messages if 2 or 3 is specified in ivalType.
timeTo Interval end (UNIX time).
type Sensors group: lls, sensors, ignition, trips. See more.
filter1 Sensor ID. Specify 0 to add all sensors according to the selected type.
measure Measurement system:
  • 0 for SI;
  • 1 for US;
  • 2 for imperial.

The default value is 0.
lang Language (2-symbol code). The default value is en.

If you need to load events for another period into the session, first use the events/unload request and then events/load.

ivalType

Value Description
1 Requests messages (events) from timeFrom to timeTo.
2 Requests the number of messages specified in timeFrom, beginning from timeTo.
3 Requests the number of messages specified in timeFrom, up to timeTo.
4 Requests messages from timeFrom to timeTo, including one message before timeFrom.
5 Requests messages from timeFrom to timeTo, including one message after timeTo.
6 Requests messages from timeFrom to timeTo, including one message before timeFrom and one message after timeTo.

Response

If the request is completed successfully, the following response is returned:

Copied!
{
"events":{
"counters":{
"0":<uint> /* The number of events, that is, counter value updates in the history request. */
},
"ignition":{
"<sensor_id1>":<uint>, /* The number of events in the history request for the specified sensor. */
...
},
"lls":{
"<sensor_id2>":<uint>, /* The number of events in the history request for the specified sensor */
...
},
"sensors":{
"<sensor_id3>":<uint>, /* The number of events in the history request for the specified sensor */
...
"trips":{
"0":<uint> /* The number of events in the history request for trips */
}
},
"selector":[
{
...
}, /* Selection results. If the "selector" parameter was skipped, then {} is returned. You can see the server response in "events/get". */
...
]
}

If the request is not completed, an error code is returned.

Error codes

Code Description
1 Invalid or obsolete request SID.
4 One of the following errors:
  • error validating parameters,
  • error fetching the history loader,
  • empty list of detectors.
5 Events are disabled or initializing.
6 Failed to load events or fetch the JSON writer.
7 The adf_avl_events library wasn’t loaded or failed to fetch the item with the required access right (ADF_ACL_ITEM_EXECUTE_REPORTS).

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

Report a mistake

Your message was sent. Thank you!

An error occurred while submitting the form

See also