update_data_flags

The update_data_flags function is used to add and delete items from a session. Adding items to a session is necessary to receive events from them.

Copied!
svc=core/update_data_flags&params={"spec":[
					{
						"type":"<text>",
						"data":<long|text|[long]>,
						"flags":<long>,	
						"mode":<uint>,
						"max_items":<uint>
					}
				   ]}

Parameters

NameDescription
specThe array of units with a configuration for requesting the modification of items that are in the session.
typeThe method of transferring items to the session:
  • id: by ID. If this method is selected, you should specify the item ID in the data parameter.

  • type: by type. If this method is selected, you should specify the type of items in the data parameter (see search_items).

  • col: by ID list. If this method is selected, you should specify an array of IDs of the required items in the data parameter.

  • access: subscribing to events about creating/deleting, obtaining/denying the items access rights, in the data parameter: 1, enable; 0, disable.

dataData. This parameter depends on the previous one.
flagsThe flags that define what information about items should be added to the session. The item flags of each type are described in the Data format section.
modeThe flag application mode:
  • 0: redefine flags for the specified items.

  • 1: add the specified flags to the existing ones in the session.

  • 2: delete the specified flags from the session (when deleting the basic flag, the item is deleted from the session).

The flags are specified to monitor changes in the specific properties of the item. The number of specified flags depends on your needs. If you want to receive all events, all flags should be specified. You can receive the events using the avl_evts function.

max_items

The maximum number of subscribed items. Available only when type='type'.

Returned result

Copied!
[		/* array of items*/
	{
		"i":<long>,	/* ID */
		"d":{		/* other fields */
			...
		},
		"f":<long>	/* applied flags with properties */
	},
	...
]

The “d” field format depends on the returned item type. If the “2” flag mode is indicated when sending this request, the null value is returned to the “d” field. The formats of all item types are described in the Data format section.

Possible error codes:

CodeDescription
4Wrong input parameters or error updating flags.
Download PDF file
Download Word document

See also