update_event_data
To specify event parameters, use the unit/update_event_data method.
svc=unit/update_event_data¶ms={
"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:
|
| 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.
svc=unit/update_event_data¶ms={
"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:
{
"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. |