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.

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).

Copied!
{
  "nm": <text>,   // Name
  "cls": <uint>,  // Superclass ID of avl_resource, usually 3 (see the classes key in the token/login response)
  "id": <uint>,   // Resource ID
  "mu": <uint>,   // Measurement system: 0 (SI), 1 (US), 2 (imperial), 3 (metric with gallons)
  "uacl": <long>  // Current user's access rights to the resource (64-bit value)
}

Custom properties

The flag of custom properties is 0x00000002 (2).

You can store any resource data in custom properties.

Copied!
{
  "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)
  },
  "sph": <text>,   // Business sphere ID of the account (see account/get_business_spheres), empty if not set
  "unsl": <text>,  // Unsubscription link in emails: "0" if disabled, any other value or empty if enabled
  "drvf": <long>,  // Driver feature flags of the account
  "features": {    // Feature flags of the account, {} if there are none
    ...
  },

  // The "fleetio" and "whatsapp" objects are returned only for the resource of the account itself
  // and only if the corresponding service is enabled for this account

  "fleetio": {     // Fleetio integration settings
    "auth": <text>,  // Authorization token
    "act": <text>    // Account token
  },
  "whatsapp": {    // WhatsApp integration settings
    "accountSid": <text>,  // Twilio account SID (only for the top account and only if set)
    "authToken": <text>,   // Twilio authorization token (only for the top account and only if set)
    "phones": [<text>]     // List of phone numbers (only if set)
  },
  "ct": <uint>     // Creation time (Unix timestamp)
}

Billing information

The flag of billing information is 0x00000004 (4).

Copied!
{
  "crt": <uint>,   // Creator ID
  "bact": <uint>,  // Account ID
  "bpact": <uint>  // Parent account ID
}

General custom fields

The flag of custom fields is 0x00000008 (8).

Copied!
{
  "flds": {          // Custom fields
    "<uint>": {  // ID of the custom field
      "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
}

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.

GUID

The flag of GUID is 0x00000040 (64).

Copied!
{
  "gd":<text>  // Resource GUID
}

Administrative custom fields

The flag of administrative custom fields is 0x00000080 (128).

Copied!
{
  "aflds": {          // Administrative fields
    "<uint>": {  // ID of the administrative field
      "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
}

Drivers

The flag of drivers is 0x00000100 (256).

Copied!
{
  "drvrs": {
    <text>: {  // ID 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.
        "dbt": <uint>,    // Start time of the current working day, that is, the end of the previous daily rest (Unix timestamp)
        "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 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 drivers are still returned
}

In Wialon Local, the bye field is available starting from version 2604.

Jobs

The flag of jobs is 0x00000200 (512).

Copied!
{
  "ujb": {
    "<text>": {  // ID 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 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 jobs are still returned
}

Action types are described in the get_job_data chapter.

Notifications

The flag of notifications is 0x00000400 (1024).

Copied!
{
  "unf": {
    "<text>": {  // ID 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 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 notifications are still returned
}

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).

Copied!
{
  "poi": {
    "<text>": {  // ID of the 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 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 POIs are still returned
}

Geofences

The flag of geofences is 0x00001000 (4096).

Copied!
{
  "zl": {
    "<text>": {  // ID 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 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 geofences are still returned
}

Geofence flags are described in the get_zone_data chapter.

Report templates

The flag of report templates is 0x00002000 (8192).

Copied!
{
  "rep": {
    <text>: {  // ID of the template
      "id": <long>,  // Template ID
      "n": <text>,   // Template name
      "ct": <text>,  // Template type
      "c": <ushort>  // Checksum (CRC16)
    },
    ...
  },
  "repmax": <long>  // Maximum number of report templates 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 report templates are still returned
}

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).

Copied!
{
  "drvrun": [<long>]  // Array of unit IDs
}

Driver groups

The flag of driver groups is 0x00008000 (32768).

Copied!
{
  "drvrsgr": {          // Driver groups
    <text>: {  // ID 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 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 driver groups are still returned
}

Trailers

The flag of trailers is 0x00010000 (65536).

Copied!
{
  "trlrs": {          // Trailers
    <text>: {  // ID 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 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 trailers are still returned
}

Trailer groups

The flag of trailer groups is 0x00020000 (131072).

Copied!
{
  "trlrsgr": {          // Trailer groups
    <text>: {  // ID 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 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 trailer groups are still returned
}

List of units to which trailers can be assigned automatically

The flag of units to which trailers can be assigned automatically is 0x00040000 (262144).

Copied!
{
  "trlrun": [<long>]  // Array of unit IDs
}

Orders

The flag of orders is 0x00080000 (524288).

Copied!
{
  "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: canceled (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 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 orders are still returned
  "order_routes": {
    "<uint>": {  // ID 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 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 routes are still returned
}

Geofences groups

The flag of geofence groups is 0x00100000 (1048576).

Copied!
{
  "zg": {          // Geofence groups
    "<text>": {  // ID of the group
      "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 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 geofence groups are still returned
}

Tags (passengers)

The flag of tags (passengers) is 0x00200000 (2097152).

Copied!
{
  "tags": {
    "<uint>": {  // ID 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 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 tags are still returned
}

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).

Copied!
{
  "tagrun": [<long>]  // Array of unit IDs
}

Tags groups (passenger groups)

The flag of tag groups (passenger groups) is 0x00800000 (8388608).

Copied!
{
  "tagsgr": {
    <text>: {  // ID 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 tag groups 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 tag groups are still returned
}

If you find a mistake in the text, please select it and press Ctrl+Enter.