update_data_flags
To add items to a session or delete them from it, use the core/update_data_flags method. Add items to a session to receive events from them.
Endpoint
svc=core/update_data_flags¶ms={
"spec": [
{
"type": "<text>",
"data": <long|text|[long]>,
"flags": <long>,
"mode": <uint>,
"max_items": <uint>
}
]
}
Parameters
The request must contain the following parameters:
| Parameter | Description |
|---|---|
spec |
An array of objects. Each object describes which items to change in the session and how. |
type |
The way to specify items:
|
data |
Data. Depends on the type parameter. |
flags |
The flags that define what information about items to add to the session. The item flags of each type are described in the Data format section. |
mode |
The flag application mode:
|
max_items |
The maximum number of subscribed items. Available only if type is type. |
Response
If the request is completed successfully, the response is returned in the following format:
[ /* Array of items. */
{
"i": <long>, /* ID. */
"d": { /* Other fields. */
...
},
"f": <long> /* Applied flags. */
},
...
]
The d field format depends on the returned item type. d is null if the request adds no new flags (for example, mode 2); items whose flags don’t change are omitted. The formats of all item types are described in the Data format section.
If the session has a limit on the number of message parameters, the request returns the unit parameters each time you add the flag of message parameters in mode 1. For details, see Limited list of parameters.
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 1 | Invalid session. |
| 4 | Wrong input parameters or error updating flags. |