Unit groups
Depending on the specified flags, the response format may vary.
This chapter describes the flags that can be applied to unit groups 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.
Unit group flags
The following flags can be applied to unit groups:
| HEX value | DEC value | Description |
|---|---|---|
| 0x00000001 | 1 | General properties (base flag) |
| 0x00000002 | 2 | Custom properties |
| 0x00000004 | 4 | Billing information |
| 0x00000008 | 8 | Custom fields |
| 0x00000010 | 16 | Image |
| 0x00000040 | 64 | GUID |
| 0x00000080 | 128 | Administrative fields |
| 0x3FFFFFFFFFFFFFFF | 4611686018427387903 | Set all unit group flags |
General properties
The flag of general properties is 0x00000001 (1).
{
"nm": <text>, /* Name */
"cls": <uint>, /* Superclass ID of avl_unit_group, usually 5 (see the classes key in the token/login response) */
"id": <uint>, /* Group ID */
"mu": <uint>, /* Measurement system: 0 for SI, 1 for US, 2 for imperial, 3 for metric with gallons */
"u": [<long>], /* Array of group units */
"uacl": <long> /* User's access rights to the unit group (64-bit value) */
}
Custom properties
The flag of custom properties is 0x00000002 (2).
You can store any data in custom properties.
{
"prp": {}, /* Custom properties */
"ftp": { /* FTP settings (used only for accounts) */
"hs": <text>, /* Host (only if set) */
"lg": <text>, /* Login (only if set) */
"pt": <text>, /* Directory path (only if set) */
"ch": <uint>, /* FTP settings validity: 1 for yes, 0 for no */
"tp": <uint>, /* Use Wialon hosting FTP: 1 for yes, 0 for no */
"fl": <uint> /* Wialon hosting FTP availability: 1 for yes, 0 for no */
},
"ct": <uint> /* Creation time (Unix timestamp) */
}
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>: { /* Custom field ID */
"id": <uint>, /* ID */
"n": <text>, /* Name */
"v": <text>, /* Value */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"fldsmax": <long> /* Maximum number of custom fields allowed by the billing plan for the account (-1 for unlimited). It can be 0 if the service isn't in the billing plan; existing custom fields are still returned */
}
Unit group image
The flag of the unit group image is 0x00000010 (16).
{
"uri": "<text>", /* Path to the unit group image on the server. Add it to the Wialon server address to get the image */
"ugi": <uint> /* Number of image changes */
}
GUID
The flag of GUID is 0x00000040 (64).
{
"gd": <text> /* group GUID */
}
Administrative fields
The flag of administrative fields is 0x00000080 (128).
{
"aflds": { /* Administrative fields */
<text>: { /* Administrative field ID */
"id": <uint>, /* ID */
"n": <text>, /* Name */
"v": <text>, /* Value */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"afldsmax": <long> /* Maximum number of administrative fields allowed by the billing plan for the account (-1 for unlimited). It can be 0 if the service isn't in the billing plan; existing administrative fields are still returned */
}