update_event_data

To specify event parameters, use the unit/update_event_data method.

Copied!
svc=unit/update_event_data&params={
    "itemId": <long>,
    "eventType": <text>,
    "ivalType": <int>,
    "ivalFrom": <uint>,
    "ivalTo": <uint>,
    "params": {
        "test1": <uint>,
        "test2": <text>
    }
}

Parameters

The request must contain the following parameters:

Parameter Description
itemId Unit ID.
eventType Type of event. For example:
  • lls — fuel level
  • theft — fuel drain
  • filling — fuel filling
  • sensors — sensor values
  • ignition — ignition state
ivalType Type of the time interval. The value must be greater than 0. Use 1 to select the events inside the interval.
ivalFrom Beginning of the interval, Unix time.
ivalTo End of the interval, Unix time.
params Object with updated parameters.

Example

Below is an example of the unit/update_event_data request.

Copied!
svc=unit/update_event_data&params={
    "itemId": 1555,
    "eventType": "lls",
    "ivalType": 1,
    "ivalFrom": 1689734883,
    "ivalTo": 1689738483,
    "params": {
        "test1": 1
    }
}

Response

If the request is completed successfully, a response in the following format is returned:

Copied!

{
    "msgs": 1 /* Number of updated events. */
}

Otherwise, an error code is returned.

Error codes

Error code Description
4 Wrong input parameters.
7 No Request reports and messages access right to the unit, or the unit doesn’t support events.

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