update_trailer

The update_trailer function is used to create, edit, or delete trailers.

Copied!
svc=resource/update_trailer&params={"itemId":<long>,
				    				"id":<long>,
				    				"callMode":"<text>",
				    				"ej":{ ... },
				    				"c":"<text>",
				    				"ds":"<text>",
				    				"n":"<text>",
				    				"f":<uint>,
				    				"jp":{
				    					"<text>":"<text>",
				    					...
				    				}}

Parameters

NameDescription
itemIdResource ID.
id

Trailer ID. To create a trailer, send 0.



callMode

Modes:

  • create;
  • update;
  • delete; 
  • reset_image.

The following parameters are only required to create and update trailers:

NameDescription
ejExtended JSON (optional). { } by default.
cCode.
dsDescription.
nTrailer name.
fFlags, not currently used.
jpCustom fields in the "name":"value" format. Optional. { } by default.

Returned result

For creation and modification requests:

Copied!
[
	<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 the image */
		"ck":<ushort>		/* the check sum of the image */
		"bu":<long>,		/* the assigned unit */
		"pu":<long>,		/* the previous assigned unit */
		"bt":<uint>,		/* the time of the previous assignment/separation */
		"pos":{				/* position */	
			"y":<double>,	/* latitude */	
			"x":<double>	/* longitude */
		}
	}
]

For deletion requests:

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

Possible error codes:

CodeDescription
7Failed to fetch the resource with the desired ACL (ADF_ACL_AVL_RES_EDIT_TRAILERS).
6Undefined error.
4Wrong input parameters.
Download PDF file
Download Word document

See also