update_driver

The update_driver method 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

Name Description create update reset_image delete
itemId Resource ID.
id Driver ID (0 — create).
callMode Action: create, update, delete, reset_image.
ej Extended JSON (with example for push notifications). - -
c Code. + + - -
ck The checksum of the driver image. - - - -
ds Description. + + - -
n Name. + + - -
p The phone number, like +1234567890 ( + must be encoded as %2B). + + - -
r The aspect ratio of the driver image. - - - -
f Flags (4 — exclusive). 0 0 - -
pwd The password for the mobile authorization. + + - -
jp Custom 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:

Flag Description
0x1 Object type: Driver.
0x2 Object type: Trailer.
0x4 Restrict assignment.
0x8 Object type: Driver group.
0x10 Object type: Trailer group.

For deletion requests:

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

Possible error codes:

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

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