Users
Depending on the specified flags, the response format may vary.
This chapter describes the flags that can be applied to users and the corresponding parts of the resulting JSON they control. If multiple flags are specified, their respective parts are combined into a single JSON.
Specify flags in DEC format, as described in Data format.
The contents of the response also depend on your access rights to the item. For details, see Flags and access rights.
User flags
The following flags can be applied to users:
| HEX value | DEC value | Description |
|---|---|---|
| 0x00000001 | 1 | General properties (base flag) |
| 0x00000002 | 2 | Custom properties |
| 0x00000004 | 4 | Billing information |
| 0x00000008 | 8 | Custom fields |
| 0x00000020 | 32 | Messages (subscription only) |
| 0x00000040 | 64 | GUID |
| 0x00000080 | 128 | Administrative fields |
| 0x00000100 | 256 | Other user properties, including the host mask |
| 0x00000200 | 512 | Notifications |
| 0x00000800 | 2048 | User mobile apps |
| 0x3FFFFFFFFFFFFFFF | 4611686018427387903 | Set all user flags |
General properties
The flag of general properties is 0x00000001 (1).
{
"nm": "<text>", /* Username */
"cls": <uint>, /* Superclass ID: "user" */
"id": <uint>, /* User ID */
"mu": <uint>, /* Measurement system:
0 - SI,
1 - US,
2 - imperial,
3 - metric with gallons */
"uacl": <uint> /* User's access rights to this user */
}
Custom properties
The flag of custom properties is 0x00000002 (2).
You can store any user data in custom properties. Usually, such settings are user e-mail, map position after logging in, and so on
{
"prp": {
"cfmt": "<text>", /* Coordinates format: 0 - degrees and minutes, 1 - degrees */
"email": "<text>", /* User email */
"msc": "<text>", /* Map position after logging in: 0 - default, 1 - saved */
"poisrv": "<text>" /* Render POIs on the server */
}
}
Billing information
The flag of billing information is 0x00000004 (4).
{
"crt": <uint>, /* Creator ID */
"bact": <uint> /* Account ID */
}
Custom fields
The flag of custom fields is 0x00000008 (8).
{
"flds": { /* Custom fields */
"<text>": { /* Sequence number */
"id": <uint>, /* ID */
"n": "<text>", /* Name */
"v": "<text>" /* Value */
}
},
"fldsmax": <long> /* Maximum number of custom fields (-1 for unlimited) */
}
Messages
The flag of messages is 0x00000020 (32).
This flag doesn’t add any data to the response. It subscribes the session to new messages of the user.
To use it, set the flag for the user with core/update_data_flags. After that, every new message registered for the user is delivered as an event in avl_evts. For the message types and their format, see the Messages page.
It is recommended to combine this flag with the general properties flag 0x00000001 (1). On its own, the flag of messages makes core/update_data_flags return an empty item object in its own response, which looks as if the subscription failed.
GUID
The flag of GUID is 0x00000040 (64).
{
"gd": <text> /* User GUID */
}
Administrative fields
The flag of administrative fields is 0x00000080 (128).
{
"aflds": { /* Administrative fields */
<text>: { /* Sequence number */
"id": <uint>, /* ID */
"n": <text>, /* Name */
"v": <text> /* Value */
},
...
},
"afldsmax": <long>, /* Maximum number of administrative fields (-1 for unlimited) */
}
Other user properties
The flag of other user properties is 0x00000100 (256).
{
"fl": <uint>, /* Flags of user settings */
"hm": <text>, /* Host mask */
"ld": <uint>, /* Last login time */
"pfl": <uint>, /* Parent account flags */
"ap": {
"type": <uint>, /* Two-factor authentication type */
"phone": <text> /* Phone number for two-factor authentication */
}
}
The flags of user settings are listed on the update_user_flags page.
Notifications
The flag of notifications is 0x00000200 (512).
{
"usnf": { /* User notifications */
"<text>": { /* Sequence number */
"id": <long>, /* ID */
"t": <uint>, /* Lifetime (seconds) */
"d": "<text>", /* Notification text */
"h": "<text>", /* Subject */
"s": "<text>" /* Sender */
}
}
}
User mobile apps
The flag of user mobile apps is 0x00000800 (2048).
{
"mapps": { /* Mobile apps */
"<text>": { /* Sequence number */
"id": <long>, /* ID */
"n": <text>, /* Name */
"uid": <text>, /* Unique ID */
"cp": {}, /* Custom parameters */
"as": {}, /* Application specification */
"e": <uint>, /* Enabled: 1 for yes, 0 for no */
"ct": <uint>, /* Creation time */
"mt": <uint> /* Last modification time */
}
},
"mappsmax": <long> /* Maximum number of mobile apps (-1 for unlimited) */
}
The mapps key requires the View detailed object properties access right to the user, and mappsmax requires Act on behalf of this user.