load_last
To load a few latest messages for a specified point in time, use the messages/load_last method.
Endpoint
svc=messages/load_last¶ms={"itemId":<long>,
"lastTime":<uint>,
"lastCount":<uint>,
"flags":<uint>,
"flagsMask":<uint>,
"loadCount":<uint>}
Parameters
The required parameters are marked with an asterisk (*).
| Parameter | Description |
|---|---|
itemId* |
Unit or resource ID (depends on the type of message you want to get). |
lastTime* |
Time for which messages are requested. |
lastCount* |
Number of messages which should be loaded. |
flags* |
Message flags. Used for loading messages with the specified flags only. See Messages. |
flagsMask* |
Mask. See load_interval. |
loadCount* |
Number of messages to return. |
To load the unit log messages (the 0x1000 flag), the user needs the Manage object log access right to the unit. Without this right, log messages aren’t returned, and no error occurs.
Response
If the request is executed successfully, the following result is returned:
{
"count":<uint>, /* number of messages */
"messages":[ /* array of messages */
{
...
}
]
}
For message formats, see Messages.
If the request is not executed successfully, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters, or the lastCount value is less than 1 or greater than 10000. |
| 6 | Failed to fetch unit messages. |
| 7 | The unit doesn’t exist, or the user doesn’t have the Request reports and messages access right to it. |