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.

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

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

Custom properties

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

The prp object contains custom properties that the Wialon interface and applications store for the user, so the set of keys varies. Their values are stored as strings. Some of the keys are listed below as examples.

Copied!
{
	"prp": {
		"tz": "<text>",     // Time zone, see the page "Example of obtaining the tz parameter"
		"language": "<text>", // Interface language
		"cfmt": "<text>",   // Coordinates format: 0 — degrees and minutes, 1 — degrees
		"email": "<text>",  // User email
		"msc": "<text>",    // Map position after login: 0 — default, 1 — saved
		"poisrv": "<text>",  // Render POIs on the server
		"us_units": "<text>", // Measurement system: 0 — metric (km, l), 1 — U.S. (mi, gal), 2 — imperial (mi, UK gal) 
		"pcal": "<text>", // Persian calendar: 0 — Gregorian, 1 — Persian
		"evt_flags": "<text>",   // Notification flags: 0x1 — play sound on new notification, 0x2 — automatically open the notification popup.  
  		"user_settings_hotkeys": "<text>",   // Keyboard shortcuts: 0 — disabled, 1 — enabled.
  		"locator": "<text>",   // Access to the locator page: 0 — disabled, 1 — enabled.
  		"muf": "<text>",   // Flags of item display on the map:
    		//   0x0001 — show unit names on the map
    		//   0x0002 — show movement direction arrows
    		//   0x0008 — show the last tail (trace) for units
    		//   0x0020 — replace unit icons with signs
    		//   0x0200 — show unit icons at map borders
    		//   0x0400 — group overlapping unit icons
    		//   0x1000 — show driver names on the map
  		"us_addr_fmt": "<text>",   // Address format, including:
    		//   fmtMask (int): address components: 0 — (none), 1 — Country, 2 — Region, 3 — City, 4 — Street, 5 — House
    		//   minCityRadius (int, km or mi): minimal city radius for naming.
    		//   maxDistToUnit (int, km or mi): maximum distance to show the nearest unit.
  		"znsn": "<text>",   // Show geofence names on the map: 0 — hide, 1 — show (default 1).
  		"znsrv":"<text>",   // Render geofences on server: 0 — disabled, 1 — enabled (default 0). May be auto-enabled by the server if the user has too many geofences to render client-side.
  		"last_tail_points": "<text>",  // Number of points to display the last unit trace. Default "5".
  		"last_tail_color":  "<text>",  // Unit trace color in #RRGGBB. Default "#0000ff".
  		"last_tail_width":  "<text>",  // Unit trace width in pixels. Default "3".
  		"auth_params": "<text>",   // JSON string with 2FA configuration.
	},
	"ftp": {	// FTP settings (only for accounts)
		"hs": "<text>",	// FTP host (only if set)
		"lg": "<text>",	// FTP login (only if set)
		"pt": "<text>",	// Target directory path on the FTP server (only if set)
		"ch": <uint>,	// "Check FTP settings" toggle:
                       //   0 — do not validate the FTP connection before sending reports
                       //   1 — validate the FTP connection before sending 
		"tp": <uint>,	// "Use Wialon Hosting FTP" toggle:
                       //   0 — use custom FTP
                       //   1 — use Wialon Hosting FTP
		"fl": <uint>	// Wialon Hosting FTP availability: 1 — available, 0 — unavailable
	},
	"ct": <uint>	// Creation time (Unix timestamp)
},

  "fleetio": {           // fleetio settings (only for accounts with the "fleetio" service enabled)
    "auth": "<text>",    // Fleetio auth token
    "act":  "<text>"     // Fleetio account token
  },

  "whatsapp": {          // WhatsApp settings (only for accounts with the "WhatsApp" service enabled)
    "accountSid": "<text>",  // Twilio Account SID (top account only)
    "authToken":  "<text>",  // Twilio auth token  (top account only)
    "phones":     [ ... ]    // Array of WhatsApp phone configs; omitted if not a valid JSON array
  }

The fleetio and whatsapp objects are included only if the caller has the View detailed object properties access right to the account.

Billing information

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

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

Custom fields

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

Copied!
{
	"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
}

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 d object, which looks as if the subscription failed.

GUID

The flag of GUID is 0x00000040 (64).

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

Administrative fields

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

Copied!
{
	"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
}

Other user properties

The flag of other user properties is 0x00000100 (256).

Copied!
{
	"fl": <uint>, // Flags of user settings
	"hm": "<text>", // Host mask
	"ld": <uint>, // Last login time
	"pfl": <uint>, // Flags allowed by the parent accounts
	"ap": {         // Authentication parameters. Missing if they aren't set
	    "type": <uint>,   // Two-factor authentication type: 0 — none, 1 — email, 2 — SMS
	    "phone": "<text>", // Phone number for two-factor authentication
	    "gmail": "<text>"  // Email of the connected authentication service
	}
}

The flags of user settings are listed on the user/update_user_flags page. The pfl value uses the same flags: it contains the flags that are set for all the parent accounts of the user, up the hierarchy.

The ap object is returned only if the authentication parameters are set with user/update_auth_params or user/bind_auth_service. The name of the authentication service key depends on the service, for example, gmail.

Notifications

The flag of notifications is 0x00000200 (512).

Copied!
{
	"usnf": {  // User notifications
		"<text>": {  // Notification ID
			"id": <long>,  // ID
			"t": <uint>,  // Lifetime (seconds)
			"d": "<text>",  // Notification text
			"h": "<text>",  // Subject
			"s": "<text>",  // Sender
			"ct": <uint>,  // Creation time (Unix timestamp)
			"mt": <uint>  // Last modification time (Unix timestamp)
		}
	}
}

User mobile apps

The flag of user mobile apps is 0x00000800 (2048).

Copied!
{
	"mapps": {          // Mobile apps
		"<text>": {         // Mobile app ID
			"id": <long>,   // ID
			"n": "<text>",  // Name
			"uid": "<text>", // Device token for push notifications
			"cp": {},       // Custom parameters set by the mobile app
			"as": {},       // Application specification set by the mobile app
			"e": <uint>,    // Enabled: 1 — yes, 0 — no
			"ct": <uint>,   // Creation time (Unix timestamp)
			"mt": <uint>    // Last modification time (Unix timestamp)
		}
	},
	"mappsmax": <long>  // Maximum number of mobile apps 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 mobile apps are still returned
}

The mapps key requires the View detailed object properties access right to the user, and mappsmax requires Act on behalf of this user.

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