load_interval

To load messages for a certain interval, use the command messages/load_interval:

Copied!
svc=messages/load_interval&params={"itemId":<long>,
				   "timeFrom":<uint>,
				   "timeTo":<uint>,
				   "flags":<uint>,
				   "flagsMask":<uint>,
				   "loadCount":<uint>}

This request can’t be executed simultaneously with the following requests:

Parameters

The required parameters are marked with an asterisk (*).

Name

Description

itemId*

Unit or resource ID (depends on the type of message you want to get).

timeFrom*

Interval beginning. 

timeTo*

Interval end.

flags*

Flags for loading messages. See the description below.

flagsMask*

Mask. See the description below.

loadCount*

Number of messages to return (0xffffffff means all the found ones).

Examples of using masks and flags:

Mask

Flag

Result

0xFF00

0x0000

All data messages.

0xFF10

0x0010

Data messages which contain the alarm bit (0x10).

0xFFF0

0x0010

Data messages which contain the alarm bit (0x10), but don't contain information about the driver code (0x20).

0xFFF2

0x0022

Data messages which contain information about the driver code (0x20) and input data information (0x02), but don't contain the alarm bit (0x10).

0xFF01

0x0601

Events regarded as violations.

Response

If the request is completed successfully, the response is as follows:

Copied!
{
	"count":<uint>,				/* number of messages */
	"messages":[				/* array of messages */
		{
			...		
		}
	]
}

You can find message formats, masks and flags here.

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

Error codes

Error codeDescription
7Failed to fetch the message manager.
6Failed to fetch messages for the interval.
4Failed to get the current user.
1003Accept-encoding is not gzip.
Download PDF file
Download Word document

See also