update_events
To mark a fuel filling or drain as false, use the unit/update_events command.
svc=unit/update_events¶ms={
"events": [
{
"itemId": <long>,
"resourceId": <long>,
"eventType": <text>,
"timeFrom": <uint>,
"timeTo": <uint>,
"params": {
"mark": <uint>
}
}
]
}
Parameters
The request must contain the following parameters:
Parameter | Description |
---|---|
itemId | Unit ID. |
resourceId | ID of the resource in which the executed report is stored. |
eventType | Type of event (lls, fuel drain, fuel filling, sensors,ignition, trips, etc.) |
timeFrom | Event beginning. |
timeTo | Event end. |
params | Object with updated parameters. |
Example
Below is an example of the unit/update_events request.
svc=unit/update_events¶ms={
"events": [
{
"itemId": 1555,
"resourceId": 123,
"eventType": "lls",
"timeFrom": 1689734883,
"timeTo": 1689734883,
"params": {
"mark": 1
}
}
]
}
Response
If the request is completed successfully, a response in the following format is returned:
{
"items": [
{
"itemId": 1285,
"error": 0, /* 0 - success, 7 - no access right */
"msgs": 1
},
{
"itemId": 1285,
"error": 0,
"msgs": 1
}
]
}
If the request fails, an error code is returned.
Error codes
Error code | Description |
---|---|
4 | Wrong input parameters. |
5 | Events are disabled for the unit. |
7 | No ADF_ACL_AVL_RES_EDIT_REPORTS access right to the resource, or no ADF_ACL_ITEM_VIEW access right to the unit. |