Resources

Depending on set flags format of response can differ.

This chapter describes flags that can be applied to resources and parts of resulting JSON which they are responsible for. If you specify several flags, then parts will be united into one JSON.

Resource flags:

Value Description
0x00000001 base flag
0x00000002 custom properties
0x00000004 billing properties
0x00000008 custom fields
0x00000040 GUID
0x00000080 administrative fields
0x00000100 drivers
0x00000200 jobs
0x00000400 notifications
0x00000800 POIs
0x00001000 geofences
0x00002000 report templates
0x00004000 list of auto attachable units for drivers
0x00008000 driver groups
0x00010000 trailers
0x00020000 trailer groups
0x00040000 list of auto attachable units for trailers
0x00080000 orders
0x3FFFFFFFFFFFFFFF set all possible flags to resource

General properties

Flag - 0x00000001

{
	"nm":<text>,	/* name */
	"cls":<uint>,	/* superclass ID: "avl_resource" */
	"id":<uint>,	/* resource ID */
	"uacl":<uint>	/* current user access level for resource */
}

Custom properties

Flag - 0x00000002

You can store any resource data you need in custom properties.

{
	"prp":{				/* custom properties */
		"emails":"[<text>]",		/* list of e-mails for jobs */
		"nf_rep_emails":"[<text>]",	/* list of e-mail for notifications */
		"phones":"[<text>]",		/* list of phone numbers for job "Send fuel information by e-mail or SMS" */
		...
	}
}

Billing

Flag - 0x00000004

{
	"crt":<uint>,	/* creator ID */
	"bact":<uint>	/* account ID */
}

Custom fields

Flag - 0x00000008

{
	"flds":{	/* custom fields */		
		"<uint>":{	/* sequence number */
			"id":<uint>,	/* ID */
			"n":<text>,	/* name */
			"v":<text>	/* value */
		},
		...
	},
	"fldsmax":<long>,	/* maximal count of custom fields (-1 - unlimited) */
}

GUID

Flag - 0x00000040

{
	"gd":<text>	/* resource GUID */
}

Administrative fields

Flag - 0x00000080

{
	"aflds":{	/* administrative fields */		
		"<uint>":{	/* sequence number */
			"id":<uint>,	/* ID */
			"n":<text>,	/* name */
			"v":<text>	/* value */
		},
		...
	},
	"afldsmax":<long>,	/* maximal count of administrative fields (-1 - unlimited) */
}

Drivers

Flag - 0x00000100

{
	"drvrs":{
		<text>:{	/* sequence number of driver */
			"id":<long>,	/* ID */
			"n":<text>,	/* name */
			"c":<text>,	/* code */
			"jp": {			/* custom fields */
				<text>:<text>,		/* name: value */
				...
			},
			"ds":<text>,	/* description */
			"p":<text>,	/* phone number */
			"r":<double>,	/* image aspect ratio */
			"ck":<ushort>	/* check sum (CRC16) */
			"bu":<long>,	/* binded unit */
			"pu":<long>,	/* previous binded unit */
			"bt":<uint>,	/* time of last binging/unbinding */
			"pos":{		/* position */
				"y":<double>,	/* latitude */
				"x":<double>	/* longitude */
			}
		},
		...
	},
	"drvrsmax":<long>	/* maximal count of drivers (-1 - unlimited) */
}

Jobs

Flag - 0x00000200

{
	"ujb":{
		<text>:{		/* sequence number of job */
			"id":<uint>,		/* ID */
			"n":<text>,		/* name */
			"d":<text>,		/* description */
			"m":<uint>,		/* maximal allowed executions count */
			"st":{			/* state */
				"e":<uint>,		/* active/inactive */
				"c":<uint>,		/* executions count */
				"l":<uint>		/* last execution time */
			},
			"act":<text>		/* action type */
		},
		...
	},
	"ujbmax":<long>,	/* maximal count of jobs (-1 - unlimited) */
}

Types of actions are described in the chapter Jobs: detailed information.

Notifications

Flag - 0x00000400

{
	"unf":{
		<text>:{	/* sequence number of notification */
			"id":<long>,	/* ID */
			"n":<text>,	/* name */
			"ta":<uint>,	/* activation time */
			"td":<uint>,	/* deactivation time */
			"ma":<uint>,	/* maximal alarms count (0 - unlimited) */
			"fl":<uint>,	/* notification types */
			"ac":<uint>,	/* alarms count */
			"un":[<long>],	/* array of units IDs */
			"act":[<text>],	/* actions list */
			"trg":<text>,	/* type of control */
			"crc":<long>	/* check sum of binary view of notification */
		},
		...
	},
	"unfmax":<long>,	/* maximal count of notifications (-1 - unlimited) */
}

Action types, control types and notification flags are described in the chapter Notifications: detailed information.

POIs

Flag - 0x00000800

>
{
	"poi":{
		<text>:{	/* sequence number of POI */
			"id":<long>,	/* ID */
			"n":<text>,	/* name */
			"y":<double>,	/* latitude */
			"x":<double>,	/* longitude */
			"t":<double>,	/* image aspect ratio */
			"i":<short>,	/* check sum of image (CRC16) */
			"e":<ushort>	/* check sum of POI (CRC16) */
		},
		...
	},
	"poimax":<long>		/* maximal count of POIs (-1 - unlimited) */
}

Geofences

Flag - 0x00001000

{
	"zl":{
		<text>:{	/* sequence number of geofence */
			"n":<text>,	/* name */
			"d":<text>,	/* description */
			"id":<long>,	/* ID */
			"f":<uint>,	/* flags */
			"t":<int>,	/* type: 1 - line, 2 - polygon, 3 - circle */
			"e":<ushort>	/* check sum (CRC16) */
			"b":{	/* configuration for rendering geofences */
				"min_x":<double>,	/* minimal longitude */
				"min_y":<double>,	/* minimal latitude */
				"max_x":<double>,	/* maximal longitude */
				"max_y":<double>,	/* maximal latitude */
				"cen_x":<double>,	/* longitude of center  */
				"cen_y":<double>	/* latitude of center */
			}			
		},
		...
	},
	"zlmax":<long>	/* maximal count of geofences (-1 - unlimited) */
}

Geofence flags are described in the chapter Geofences: detailed information.

Report templates

Flag - 0x00002000

{
	"rep":{
		<text>:{	/* sequence number of template */
			"id":<long>,	/* ID */
			"n":<text>,	/* name */
			"ct":<text>,	/* template type */
			"c":<ushort>	/* check sum (CRC16) */
		},
		...
	},
	"repmax":<long>	/* maximal count of templates (-1 - unlimited) */
}

Types of templates are described in the chapter Get templates data.

List of auto attachable units for drivers

Flag - 0x00004000

{
	"drvrun":[<long>]	/* array IDs of auto attachable units */
}

Driver groups

Flag - 0x00008000

{
	"drvrsgr":{	/* driver groups */
		<text>:{	/* sequence number of group */
			"id":<long>,	/* group ID */
			"n":<text>,	/* name */
			"d":<text>,	/* description */
			"drs":[<uint>]	/* array of drivers IDs */
		},
		...
	},
	"drvrsgrmax":<long>	/* maximal count of driver groups (-1 - unlimited) */
}

Trailers

Flag - 0x00010000

{
	"trlrs":{	/* trailers */
		<text>:{	/* sequence number of trailer */
			"id":<long>,	/* trailer ID */
			"n":<text>,	/* name */
			"c":<text>,	/* code */
			"jp":{		/* custom fields */
				<text>:<text>,	/* name: value */
				...
			},
			"ds":<text>,	/* description */
			"p":<text>,	/* phone number */
			"r":<double>,	/* image aspect ratio */
			"ck":<short>,	/* check sum of image */
			"bu":<long>,	/* binded unit */
			"pu":<long>,	/* previous binded unit */
			"bt":<uint>,	/* time of last binding/unbinding */
			"pos":{		/* position */
				"y":<double>,	/* latitude */
				"x":<double>	/* longitude */
			}
		}
	},
	"trlrsmax":<long>	/* maximal count of trailers (-1 - unlimited) */
}

Trailer groups

Flag - 0x00020000

{
	"trlrsgr":{	/* trailer groups */
		<text>:{	/* sequence number of group */
			"id":<long>,	/* group ID */
			"n":<text>,	/* name */
			"d":<text>,	/* description */
			"drs":[<uint>]	/* array of trailers IDs */
		}
	},
	"trlrsgrmax":<long>	/* maximal count of trailer groups (-1 - unlimited) */
}

List of auto attachable units for trailers

Flag - 0x00040000

{
	"trlrun":[<long>]	/* array IDs of auto attachable units */
}

Orders

Флаг - 0x00080000

{
   "orders":{
        "<uint>": {      /* order number, the same as in "id" param */
		    "id":<uint>,	/* order id within resource */
		    "n":<text>,	        /* order name */
		    "p":{		/* user-defined object content */
			    ...
		    },
		    "f":<bool>,	        /* order flags: 1 - order would be marked as completed if there were at least one message within order area with zero speed in it */
		    "tf":<uint>,	/* lower bound of order completion time */
		    "tt":<uint>,	/* upper bound of order completion time  */
		    "uid":<uint>,	/* unique id (is used as unique key in order history) */
		    "r":<uint>,	        /* order point radius */
		    "y":<double>,	/* order point lattitude */
		    "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) */
		    "st":<uint>	        /* last status modification time */
	},
        ...
   }
}
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam