Resources
Depending on the specified flags, the response format may vary.
This chapter describes the flags that can be applied to resources 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.
Resource flags
The following flags can be applied to resources:
| HEX value | DEC value | Description |
|---|---|---|
| 0x00000001 | 1 | Base flag |
| 0x00000002 | 2 | Custom properties |
| 0x00000004 | 4 | Billing information |
| 0x00000008 | 8 | General custom fields |
| 0x00000020 | 32 | Messages (subscription only) |
| 0x00000040 | 64 | GUID |
| 0x00000080 | 128 | Administrative custom fields |
| 0x00000100 | 256 | Drivers |
| 0x00000200 | 512 | Jobs |
| 0x00000400 | 1024 | Notifications |
| 0x00000800 | 2048 | POIs |
| 0x00001000 | 4096 | Geofences |
| 0x00002000 | 8192 | Report templates |
| 0x00004000 | 16384 | List of units to which drivers can be assigned automatically |
| 0x00008000 | 32768 | Driver groups |
| 0x00010000 | 65536 | Trailers |
| 0x00020000 | 131072 | Trailer groups |
| 0x00040000 | 262144 | List of units to which trailers can be assigned automatically |
| 0x00080000 | 524288 | Orders |
| 0x00100000 | 1048576 | Geofences groups |
| 0x00200000 | 2097152 | Tags (passengers) |
| 0x00400000 | 4194304 | List of units to which tags (passengers) can be assigned automatically |
| 0x00800000 | 8388608 | Tag groups (passenger groups) |
| 0x3FFFFFFFFFFFFFFF | 4611686018427387903 | Set all possible resource flags |
General properties
The flag of general properties is 0x00000001 (1).
{
"nm": <text>, /* Name */
"cls": <uint>, /* Superclass ID: "avl_resource" */
"id": <uint>, /* Resource ID */
"mu": <uint>, /* Measurement system:
0 — SI,
1 — US,
2 — imperial,
3 — metric with gallons */
"uacl": <uint> /* Current user's access rights to the resource */
}
Custom properties
The flag of custom properties is 0x00000002 (2).
You can store any resource data in custom properties.
{
"prp": { /* Custom properties */
"emails": "[<text>]", /* List of emails for jobs */
"nf_rep_emails": "[<text>]", /* List of emails for notifications */
"phones": "[<text>]" /* List of phone numbers for the "Send fuel information by email or SMS" job */
...
},
"ftp": { /* FTP settings */
"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 — yes, 0 — no */
"tp": <uint>, /* Use Wialon hosting FTP: 1 — yes, 0 — no */
"fl": <uint> /* Wialon hosting FTP availability: 1 — yes, 0 — 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 */
"bpact": <uint> /* Parent account ID */
}
General custom fields
The flag of custom fields is 0x00000008 (8).
{
"flds": { /* Custom fields */
"<uint>": { /* Sequence number */
"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 (-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 resource. Resources store the records of triggered notifications as messages.
To use it, set the flag for the resource with core/update_data_flags. After that, every new message registered for the resource is delivered as an event in avl_evts.
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.
To get the notification messages of a resource for a time period, use the messages/load_interval method with the resource ID and the 0x4000 message flag.
GUID
The flag of GUID is 0x00000040 (64).
{
"gd":<text> /* Resource GUID */
}
Administrative custom fields
The flag of administrative custom fields is 0x00000080 (128).
{
"aflds": { /* Administrative fields */
"<uint>": { /* Sequence number */
"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 (-1 for unlimited) */
}
Drivers
The flag of drivers is 0x00000100 (256).
{
"drvrs": {
<text>: { /* Sequence number of the driver */
"id": <long>, /* ID */
"n": <text>, /* Name */
"c": <text>, /* Code */
"pwd": <text>, /* Password for mobile authorization */
"ej": <text>, /* Extended JSON */
"jp": { /* Custom fields */
<text>: <text>, /* Name: value */
...
},
"ds": <text>, /* Description */
"p": <text>, /* Phone number */
"r": <double>, /* Image aspect ratio */
"f": <uint>, /* Flags */
"ck": <ushort>, /* Image checksum (CRC16) */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint>, /* Last modification time (Unix timestamp) */
"bu": <long>, /* Assigned unit */
"pu": <long>, /* Previous assigned unit */
"bt": <uint>, /* Time of the last assignment/separation */
"bs": <long>, /* ID of the sensor that confirms the assignment */
"pos": { /* Location */
"y": <double>, /* Latitude */
"x": <double> /* Longitude */
},
"bye": <uint>, /* Always 1. Present only if assignments are tracked by events and their logging is on */
"infr": { /* Parameters for analyzing the driver's work and rest infringements (AETR).
Present only if the driver has AETR data */
"a": <uint>, /* Current activity */
"t": <uint>, /* Start time of the current activity */
"ud": <uint>, /* Uninterrupted driving duration before the current activity */
"ur": <uint>, /* Uninterrupted rest duration before the current activity */
"uil": <uint>, /* Allowed duration of uninterrupted driving */
"uim": <uint>, /* Maximum uninterrupted driving duration for a minor infringement */
"uis": <uint>, /* Maximum uninterrupted driving duration for a serious infringement. If exceeded, the infringement is classified as very serious. */
"uir": <uint>, /* Required rest duration */
"ddt": <uint>, /* Daily driving time before the current activity */
"ddc": <uint>, /* Number of times daily driving can be prolonged this week */
"ddil": <uint>,/* Allowed duration of daily driving */
"ddim": <uint>,/* Maximum daily driving duration for a minor infringement */
"ddis": <uint>,/* Maximum daily driving duration for a serious infringement. If exceeded, the infringement is classified as very serious. */
"wdt": <uint>, /* Weekly driving duration before the current activity */
"wdil": <uint>,/* Allowed duration of weekly driving */
"wdim": <uint>,/* Maximum weekly driving duration for a minor infringement */
"wdis": <uint>,/* Maximum weekly driving duration for a serious infringement. If exceeded, the infringement is classified as very serious. */
"twdt": <uint>,/* Biweekly driving duration before the current activity */
"twdil": <uint>,/* Allowed biweekly driving duration */
"twdim": <uint>,/* Maximum biweekly driving duration for a minor infringement */
"twdis": <uint>,/* Maximum biweekly driving duration for a serious infringement. If exceeded, the infringement is classified as very serious. */
"drt": <uint>, /* Previous daily rest duration*/
"drd": <uint>, /* Required daily rest duration */
"dril": <uint>, /* Time before which daily rest should occur */
"drim": <uint>, /* Time before which the infringement is classified as minor */
"dris": <uint>, /* Time before which the infringement is classified as serious. If exceeded, the infringement is classified as very serious. */
"wrt": <uint>, /* Previous weekly rest duration*/
"wrd": <uint>, /* Required weekly rest duration */
"wril": <uint>, /* Time before which weekly rest should occur */
"wrim": <uint>, /* Time before which the infringement is classified as minor */
"wris": <uint> /* Time before which the infringement is classified as serious If exceeded, the infringement is classified as very serious. */
}
},
...
},
"drvrsmax": <long> /* Maximum number of drivers (-1 for unlimited) */
}
In Wialon Local, the bye field is available starting from version 2604.
Jobs
The flag of jobs is 0x00000200 (512).
{
"ujb": {
"<text>": { /* Sequence number of the job */
"id": <uint>, /* ID */
"n": <text>, /* Name */
"d": <text>, /* Description */
"m": <uint>, /* Maximum allowed number of executions */
"st": { /* State */
"e": <uint>, /* Active (1) / Inactive (0) */
"c": <uint>, /* Number of executions */
"l": <uint> /* Last execution time (UTC) */
},
"act": <text>, /* Action type */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"ujbmax": <long> /* Maximum number of jobs (-1 for unlimited) */
}
Action types are described in the get_job_data chapter.
Notifications
The flag of notifications is 0x00000400 (1024).
{
"unf": {
"<text>": { /* Sequence number of the notification */
"id": <long>, /* Notification ID */
"n": <text>, /* Name */
"txt": <text>, /* Notification text */
"ta": <uint>, /* Activation time */
"td": <uint>, /* Deactivation time */
"ma": <uint>, /* Maximum number of triggers (0 for unlimited) */
"fl": <uint>, /* Notification types */
"ac": <uint>, /* Number of triggers */
"un": [<long>], /* Array of unit IDs */
"act": [<text>], /* List of actions */
"trg": <text>, /* Control type */
"trg_p": { /* Control type parameters, without "expression" and "conditions".
Empty for the "expression" control type */
...
},
"expression": <text>, /* Control type expression (only if set) */
"conditions": { /* Control type conditions (only if set), where the key is the condition type */
<text>: {
...
},
...
},
"crc": <long>, /* Checksum of the binary view of the notification */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"unfmax": <long> /* Maximum number of notifications (-1 for unlimited) */
}
The expression and conditions fields aren’t available in Wialon Local.
Action types, control types and notification flags are described in the get_notification_data chapter.
POIs
The flag of POIs is 0x00000800 (2048).
{
"poi": {
"<text>": { /* Sequence number of POI */
"id": <long>, /* POI ID */
"n": <text>, /* Name */
"y": <double>, /* Latitude */
"x": <double>, /* Longitude */
"r": <uint>, /* Radius in meters */
"t": <double>, /* Image presence: 1 if the POI has an image, 0 if it doesn't */
"i": <short>, /* Image checksum (CRC16), 0xFFFFFFFF if there's no image */
"icon": <text>, /* Image URL */
"libId": <long>, /* Icon library ID */
"path": <text>, /* Icon path in the library */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"poimax": <long> /* Maximum number of POIs (-1 for unlimited) */
}
Geofences
The flag of geofences is 0x00001000 (4096).
{
"zl": {
"<text>": { /* Sequence number of the geofence */
"n": <text>, /* Name */
"d": <text>, /* Description */
"id": <long>, /* ID */
"f": <uint>, /* Flags */
"t": <int>, /* Type: 1 — line, 2 — polygon, 3 — circle */
"w": <uint>, /* Line width or circle radius, in meters or feet depending on the measurement system */
"e": <ushort>, /* Checksum (CRC16) */
"c": <uint>, /* ARGB color */
"i": <ushort>, /* Checksum of image (CRC16), 0xFFFFFFFF if there's no image */
"icon": <text>, /* Image URL (only if the geofence has an icon) */
"libId": <long>,/* Icon library ID */
"path": <text>, /* Icon path in the library, empty if the icon isn't taken from a library */
"b": { /* Configuration for rendering geofences */
"min_x": <double>, /* Minimum longitude */
"min_y": <double>, /* Minimum latitude */
"max_x": <double>, /* Maximum longitude */
"max_y": <double>, /* Maximum latitude */
"cen_x": <double>, /* Longitude of the geofence center */
"cen_y": <double> /* Latitude of the geofence center */
},
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint>, /* Last modification time (Unix timestamp) */
"jp": { /* Custom fields (only if set) */
<text>: <text>, /* Name: value */
...
}
},
...
},
"zlmax": <long> /* Maximum number of geofences (-1 for unlimited) */
}
Geofence flags are described in the get_zone_data chapter.
Report templates
The flag of report templates is 0x00002000 (8192).
{
"rep": {
<text>: { /* Sequence number of the template */
"id": <long>, /* Template ID */
"n": <text>, /* Template name */
"ct": <text>, /* Template type */
"c": <ushort> /* Checksum (CRC16) */
},
...
},
"repmax": <long> /* Maximum number of templates (-1 for unlimited) */
}
Template types are described in the get_report_data chapter.
List of units to which drivers can be assigned automatically
The flag of units to which drivers can be assigned automatically is 0x00004000 (16384).
{
"drvrun": [<long>] /* Array of unit IDs */
}
Driver groups
The flag of driver groups is 0x00008000 (32768).
{
"drvrsgr": { /* Driver groups */
<text>: { /* Sequence number of the group */
"id": <long>, /* Group ID */
"n": <text>, /* Group name */
"d": <text>, /* Group description */
"drs": [<uint>], /* Array of driver IDs */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"drvrsgrmax": <long> /* Maximum number of driver groups (-1 for unlimited) */
}
Trailers
The flag of trailers is 0x00010000 (65536).
{
"trlrs": { /* Trailers */
<text>: { /* Sequence number of the trailer */
"id": <long>, /* Trailer ID */
"n": <text>, /* Trailer name */
"c": <text>, /* Trailer code */
"ej": <text>, /* Extended JSON */
"jp": { /* Custom fields */
<text>: <text>, /* Name: value */
...
},
"pwd": <text>, /* Password for mobile authorization (not used for trailers) */
"ds": <text>, /* Description */
"p": <text>, /* Phone number */
"r": <double>, /* Image aspect ratio */
"f": <uint>, /* Flags */
"ck": <short>, /* Image checksum (CRC16) */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint>, /* Last modification time (Unix timestamp) */
"bu": <long>, /* Assigned unit */
"pu": <long>, /* Previous assigned unit */
"bt": <uint>, /* Last assignment/separation time */
"bs": <long>, /* ID of the sensor that confirms the assignment */
"pos": { /* Location */
"y": <double>, /* Latitude */
"x": <double> /* Longitude */
}
},
...
},
"trlrsmax": <long> /* Maximum number of trailers (-1 for unlimited) */
}
Trailer groups
The flag of trailer groups is 0x00020000 (131072).
{
"trlrsgr": { /* Trailer groups */
<text>: { /* Sequence number of the group */
"id": <long>, /* Group ID */
"n": <text>, /* Group name */
"d": <text>, /* Group description */
"drs": [<uint>], /* Array of trailer IDs */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"trlrsgrmax": <long> /* Maximum number of trailer groups (-1 for unlimited) */
}
List of units to which trailers can be assigned automatically
The flag of units to which trailers can be assigned automatically is 0x00040000 (262144).
{
"trlrun": [<long>] /* Array of unit IDs */
}
Orders
The flag of orders is 0x00080000 (524288).
{
"orders": {
"<uint>": { /* Order number, the same as in the "id" parameter */
"id": <uint>, /* Order ID within the resource */
"n": <text>, /* Order name */
"f": <uint>, /* Order flags: 1 - marked as completed if at least one message within the order area has zero speed */
"tf": <uint>, /* Lower bound of the order completion time */
"tt": <uint>, /* Upper bound of order completion time */
"trt": <uint>, /* Tracking timeout */
"uid": <uint>, /* Unique ID (used as a unique key in the order history) */
"r": <uint>, /* Order point radius */
"y": <double>, /* Order point latitude */
"x": <double>, /* Order point longitude */
"u": <long>, /* Unit ID */
"s": <uint>, /* Order status:
0 - inactive (no unit assigned)
1 - active (unit assigned)
2 - completed in time
3 - completed overdue
4 - cancelled (not used) */
"sf": <uint>, /* Status flags */
"crt": <uint>, /* Time when the order was confirmed or rejected */
"st": <uint>, /* Time of the last state update */
"cnm": <double>,/* Mileage counter value */
"if": <uint>, /* Internal flags */
"nt": <uint>, /* Time when the order became the next one for the unit */
"stt": <uint>, /* Time when the transfer to the order started */
"dtt": <uint>, /* Time when the transfer to the order finished */
"eta": <uint>, /* Estimated time of arrival */
"rd": <uint>, /* Remaining distance */
"ds": <uint>, /* Completion state */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint>, /* Last modification time (Unix timestamp) */
"p": { /* User-defined object content */
...
},
"ej": { /* Extended JSON */
...
},
"dp": [ /* Dependencies on other orders */
...
],
"tz": <int>, /* Time zone */
"cf": { /* Custom fields */
...
},
"cmp": { /* Compatibility settings */
...
},
"gfn": [ /* Geofences of the order */
...
],
"rp": <text> /* Route path */
},
...
},
"ordersmax": <long>, /* Maximum number of orders (-1 for unlimited) */
"order_routes": {
"<uint>": { /* Sequence number of the route */
"id": <long>, /* Route ID */
"n": <text>, /* Route name */
"uid": <long>, /* Unique ID */
"f": <uint>, /* Route flags */
"exp": <uint>, /* Expiration time */
"ord": [<long>],/* Array of unique IDs of the orders in the route */
"fu": [<long>], /* Array of unit IDs the route is filtered by */
"st": { /* Route state */
...
},
"summary": { /* Route summary (only if calculated) */
...
},
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"order_routesmax": <long> /* Maximum number of routes (-1 for unlimited) */
}
Geofences groups
The flag of geofence groups is 0x00100000 (1048576).
{
"zg": { /* Geofence groups */
"<text>": { /* Group sequence number */
"id": <long>, /* Group ID */
"n": <text>, /* Name */
"d": <text>, /* Description */
"zns": [<uint>], /* Array of geofence IDs */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"zgmax": <long> /* Maximum number of geofence groups (-1 for unlimited) */
}
Tags (passengers)
The flag of tags (passengers) is 0x00200000 (2097152).
{
"tags": {
"<uint>": { /* Sequence number of the tag */
"id": <uint>, /* Tag ID */
"n": <text>, /* Tag name */
"c": <text>, /* Tag code */
"jp": { /* Custom fields (key:value) */
"<text>": <text>
},
"r": <double>, /* Image aspect ratio */
"ck": <ushort>, /* Image checksum (CRC16) */
"f": <uint>, /* Flags */
"bu": <long>, /* Assigned unit */
"pu": <long>, /* Previously assigned unit */
"bt": <uint>, /* Last assignment/separation time */
"tz": <int>, /* Time zone */
"art": <uint>, /* Automatic reset timeout */
"pos": { /* Location */
"y": <double>, /* Latitude */
"x": <double> /* Longitude */
},
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"tagsmax": <long> /* Maximum number of tags (-1 for unlimited) */
}
List of units to which tags can be assigned automatically
The flag of units to which tags (passengers) can be assigned automatically is 0x00400000 (4194304).
{
"tagrun":[<long>] /* Array of unit IDs */
}
Tags groups (passenger groups)
The flag of tag groups (passenger groups) is 0x00800000 (8388608).
{
"tagsgr": {
<text>: { /* Sequence number of the group */
"id": <long>, /* Group ID */
"n": <text>, /* Group name */
"d": <text>, /* Description */
"tgs": [<uint>], /* Array of tag IDs */
"ct": <uint>, /* Creation time (Unix timestamp) */
"mt": <uint> /* Last modification time (Unix timestamp) */
},
...
},
"tagsgrmax": <long> /* Maximum number of groups (-1 for unlimited) */
}