load

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

After loading, retrieve the events using the events/get method.

Endpoint

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

Parameters

Parameter Description
itemId Unit ID.
ivalType Time interval selection method (see below).
timeFrom Depends on ivalType:
  • For ivalType 1, 4, 5, or 6: interval start (UNIX time).
  • For ivalType 2 or 3: number of messages to load.
timeTo Interval end (UNIX time).
type Event detector, for example: lls, filling, theft, fuel_level, battery_level, charge, sensors, ignition, trips, counters, speedings, health_check, or eco_driving. See more.
filter1 Detector filter. For sensor-based detectors, use a sensor ID; use 0 to load all sensors of the selected type. For eco_driving, use 0 to load all criteria; a value other than 0 filters by criterion type.
measure Measurement system:
  • 0 for SI;
  • 1 for US;
  • 2 for imperial.

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

Interval selection method (ivalType)

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

Response

If the request is completed successfully, the response contains the number of loaded events for each detector requested in detectors and each detector-specific ID. The states object contains the update time for each loaded detector. The selector object is reserved for selection results.

Copied!
{
    "events": {
        "<detector_type>": {
            "<detector_specific_id>": <uint> /* number of loaded events */
        }
    },
    "states": {
        "<detector_type>": {
            "updateTime": <uint>        /* update time, UNIX time */
        }
    },
    "selector": { ... }
}

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

Error codes

Code Description
1 Invalid or obsolete request SID.
4 Parameter validation error.
5 Events are disabled or initializing.
6 Failed to load events.
7 The event service is unavailable, or the required access rights are missing.

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