Routes
Depending on the specified flags, the response format may vary.
This chapter describes the flags that can be applied to routes 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.
Route flags
The following flags can be applied to routes:
| HEX value | DEC value | Description |
|---|---|---|
| 0x00000001 | 1 | Base flag |
| 0x00000002 | 2 | Custom properties |
| 0x00000004 | 4 | Billing information |
| 0x00000040 | 64 | GUID |
| 0x00000100 | 256 | Configuration |
| 0x00000200 | 512 | Check points |
| 0x00000400 | 1024 | Schedules |
| 0x00000800 | 2048 | Rides |
| 0x3FFFFFFFFFFFFFFF | 4611686018427387903 | Set all possible route flags |
General properties
The flag of general properties is 0x00000001 (1).
{
"nm": <text>, // Name
"cls": <uint>, // Superclass ID of avl_route (see the classes key in the token/login response)
"id": <uint>, // Route ID
"mu": <uint>, // Measurement units: 0 — SI, 1 — US, 2 — imperial, 3 — metric with gallons
"uacl": <long> // User's access rights to the route (64-bit value)
}
Custom properties
The flag of custom properties is 0x00000002 (2).
You can store any route data in custom properties.
{
"prp": {}, // Custom properties
"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
}
GUID
The flag of GUID is 0x00000040 (64).
{
"gd": <text> // Route GUID
}
Configuration
The flag of configuration is 0x00000100 (256).
{
"rcfg":{ // Configuration
"color":<long>, // Color (ARGB)
"descr":<text>, // Description
"units":[<long>] // Array of unit IDs
}
}
Check points
The flag of check points is 0x00000200 (512).
{
"rpts":[ // Check points
{
"n": <text>, // Name
"gz": {}, // Geofence data (only for check points from a geofence)
"f": <uint>, // Type (see below)
"u": <long>, // Unit ID (0 if the check point isn't a check point from a unit)
"y": <double>, // Latitude (0 for check points from a geofence or a unit)
"x": <double>, // Longitude (0 for check points from a geofence or a unit)
"r": <uint> // Radius: meters, or feet if the route uses US or imperial measurement units
},
...
]
}
Check points can be of the following types:
- 1: check point from the map or POI;
- 2: check point from a geofence;
- 4: check point from a unit.
The gz object contains the same geofence data as the response of get_zone_data.
Schedules
The flag of schedules is 0x00000400 (1024).
{
"rs": { // List of schedules
"<text>": { // Schedule sequence number
"id": <long>, // Schedule ID
"n": "<text>", // Name
"f": <uint>, // Type
"tz": <uint>, // Time zone
"cfg": { // Configuration (can also contain other custom keys)
"autoName": <byte>, // Use an automatically generated name: 1 — yes, 0 — no
"depEnable": <bool>, // Control departure from check points ("Departure" column on the "Schedule" tab of the schedule properties): true (enabled) or false (disabled)
"description": "<text>", // Ride description
"enabled": <byte>, // Create rides for the schedule automatically: 1 — yes, 0 — no
"name": "<text>", // Ride name
"roundFlags": <uint>, // Ride flags
"units": [<long>], // Array of unit IDs
"validityPeriod": <uint> // Validity period
},
"tm": [ // Point visit time
{
"at": <uint>, // Arrival time
"ad": <uint>, // Deviation from the arrival time
"dt": <uint>, // Departure time
"dd": <uint> // Deviation from the departure time
}
],
"sch": { // Time limitation
"f1": <uint>, // Beginning of interval 1
"f2": <uint>, // Beginning of interval 2
"t1": <uint>, // End of interval 1
"t2": <uint>, // End of interval 2
"m": <uint>, // Mask for days of the month
"y": <uint>, // Month mask
"w": <uint>, // Mask for days of the week
"fl": <uint> // Flags (always 0 for route schedules)
},
"ct": <uint>, // Creation time (Unix timestamp)
"mt": <uint> // Last modification time (Unix timestamp)
}
}
}
Schedule types are described in the update_schedule chapter.
Rides
The flag of rides is 0x00000800 (2048).
{
"rr": { // Rides
"<text>": { // Ride sequence number
"id": <long>, // Ride ID
"n": "<text>", // Name
"d": "<text>", // Description
"sh": "<text>", // Schedule name
"f": <uint>, // Ride flags
"tz": <uint>, // Time zone
"u": <long>, // Unit assigned to this ride
"at": <uint>, // Activation time
"vt": <uint>, // Time from which validity period begins
"vp": <uint>, // Validity period
"sts": <uint>, // State flags
"st": { // Ride state
"st": { // General ride state
"pi": <uint>, // Index of the check point (4294967295 if the ride hasn't started)
"ps": <uint>, // State and event flags
"ut": <uint> // Last event time
},
"pts": { // State by points
"<text>": { // Index of the check point, starting from 0
"st": <uint>, // Event flags
"tm": <uint> // Last event time
}
}
},
"ct": <uint>, // Creation time (Unix timestamp)
"mt": <uint> // Last modification time (Unix timestamp)
}
}
}
Values of ride, state and event flags are described in the get_round_data chapter.