update_tag
The update_tag function is used to create, edit, or delete tags. The tags are used when assigning or separating passengers.
svc=resource/update_tag¶ms={"itemId":<long>,
"id":<long>,
"callMode":"<text>",
"c":"<text>",
"ck":<short>,
"n":"<text>",
"p":"<text>",
"r":<double>,
"tz":<int>,
"f":<int>,
"art":<uint>,
"jp":{
"<text>":"<text>",
...
}}
Parameters
| Name | Description |
|---|---|
| itemId | Resource ID. |
| id | Tag ID. To create a tag, send 0. |
| callMode | Modes:
|
The following parameters are only required to create and update tags:
| Name | Description |
|---|---|
| c | Code. |
| ck | The check sum of the tag image. |
| n | Tag name. |
| p | Phone number of the +1234567890 type. Should be encoded as %2B. |
| tz | Time zone. |
| jp | Custom fields in the "name":"value" format. |
| f | Flags (optional). 0 by default. |
| art | The timeout for automatic reset (optional). 36000 (10 hours) by default. |
Returned result
For creation and modification requests:
[
<long>, /* tag ID */
{
"id":<long>, /* ID */
"n":"<text>", /* name */
"c":"<text>", /* code */
"jp": { /* custom fields */
"<text>":"<text>", /* "name":"value" */
...
},
"r":<double>, /* aspect ratio of tag image */
"ck":<ushort>, /* the check sum of tag image */
"f":<ushort>, /* flag, not currently used, default value = 1 */
"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:
[
<long>, /* tag ID */
null
]
Possible error codes:
| Code | Description |
|---|---|
| 7 | Failed to fetch the resource with the desired ACL (ADF_ACL_AVL_RES_EDIT_TAGS). |
| 6 | Undefined error. |
| 4 | Wrong input parameters. |