update_driver

The update_driver function is used to create, edit, or delete drivers.

Copied!
svc=resource/update_driver&params={"itemId":<long>,
				  "id":<long>,
				  "callMode":"<text>",
				  "ej":{"apps":[{"appId":"<text>","type":"<text>","uid":"<text>","sn":"<text>"},...]},
				  "c":"<text>",
				  "ck":<short>,
				  "ds":"<text>",
				  "n":"<text>",
				  "p":"<text>",
				  "r":<double>,
				  "f":<uint>,
				  "pwd":"<text>",
				  "jp":{
				    	"<text>":"<text>",
				    	...
				  }}

Parameters

NameDescriptionRequired to
itemIdResource ID.










idDriver ID (0 — create).
callModeAction: create, update, delete, reset_image.


createupdatereset_imagedelete
ejExtended JSON (with example for push notifications).{ }{ }--
cCode.++--
ckThe check sum of driver image.----
dsDescription.++--
nName.++--
pThe phone number, like +1234567890 ( + must be encoded as %2B).++--
rThe aspect ratio of the driver image.----
fFlags (4 — exclusive).00-

-

pwdThe password for the mobile authorization.++--
jpCustom fields in the "name":"value" format.{ }{ }--

“{ }” and “0” are the default values.

Returned result

For creation, modification, and reset_image requests:

Copied!
[
	<long>,					/* driver ID */
	{
		"id":<long>,		/* driver ID */
		"n":"<text>",			/* name */
		"c":"<text>",			/* code */
		"ej":{ ... },		/* extended JSON */
		"jp": {				/* custom fields */
			"<text>":"<text>",	/* name:value */
			...
		},
		"pwd":"<text>",       /* the password for the mobile authorization */
		"ds":"<text>",		/* description */
		"p":"<text>",			/* phone number */
		"r":<double>,		/* aspect ratio of driver image */
		"f":<uint>,			/* flags (see below) */
		"ck":<ushort>,		/* check sum of driver image */
		"ct":<uint>, 		/* creation time */
		"mt":<uint>, 		/* modification time */
		"bu":<long>,		/* assigned unit */
		"pu":<long>,		/* previous assigned unit */
		"bt":<uint>,		/* time of last assignment/separation */
		"bs":<long>, 		/* sensor ID */
		"pos":{				/* position */	
			"y":<double>,	/* latitude */	
			"x":<double>	/* longitude */
		}		
	}
]

Flags:

FlagDescription
0x1Object type: Driver.
0x2Object type: Trailer.
0x4Restrict assignment.
0x8Object type: Driver group.
0x10Object type: Trailer group.

For deletion requests:

Copied!
[
	<long>,		/* driver ID */
	null
]

Possible error codes:

CodeDescription
1002Failed to update the phone number. One of the possible reasons is that the number already exists.
7Failed to fetch the resource with the desired ACL (ADF_ACL_AVL_RES_EDIT_DRIVERS).
6Undefined error.
4Wrong input parameters.
Download PDF file
Download Word document

See also