Trailers: create, edit, delete

To create, edit or delete a trailer, use the command resource/update_trailer:

svc=resource/update_trailer&params={"itemId":<long>,
				    "id":<long>,
				    "callMode":<text>,
				    "ej":<text>,
				    "c":<text>,
				    "ck":<short>,
				    "ds":<text>,
				    "n":<text>,
				    "p":<text>,
				    "r":<double>,
				    "f":<uint>,
				    "jp":{
				    	<text>:<text>,
				    	...
				    }}

Parameters

Name Description
itemId resource ID
id trailer ID (0 to create)
callMode action: create, update, delete, reset_image
Parameters required only for create and update:
ej extended JSON
c code
ck check sum of trailer image
ds description
n name
p phone number
r aspect ratio of trailer image
f flags: not used at the moment
jp custom fields in the format name: value

Response

On create and edit:

[
	<long>,		/* trailer ID */
	{
		"id":<long>,		/* trailer ID */
		"n":<text>,		/* name */
		"c":<text>,		/* code */
		"ej":<text>,		/* extended JSON */
		"jp": {			/* custom fields */
			<text>:<text>,		/* name: value */
			...
		},
		"ds":<text>,		/* description */
		"p":<text>,		/* phone number */
		"r":<double>,		/* aspect ratio of image */
		"ck":<ushort>		/* check sum of image */
		"bu":<long>,		/* bound unit */
		"pu":<long>,		/* last bound unit */
		"bt":<uint>,		/* time of last binding/unbinding */
		"pos":{			/* position */	
			"y":<double>,		/* latitude */	
			"x":<double>		/* longitude */
		}
	}
]

On delete:

[
	<long>,		/* trailer ID */
	null
]