update_tag
To create, edit, or delete tags, use the resource/update_tag method. Tags are used when assigning or separating passengers.
Endpoint
svc=resource/update_tag¶ms={
"itemId": <long>,
"id": <long>,
"callMode": <text>,
"n": <text>,
"c": <text>,
"tz": <int>,
"f": <int>,
"art": <uint>,
"jp": {
<text>: <text>,
...
}
}
Parameters
The request must contain the following parameters:
| Parameter | Description |
|---|---|
itemId |
Resource ID. |
id |
Tag ID. To create a tag, send 0. |
callMode |
Action type: create, update, delete, reset_image (delete the tag image). |
n |
Tag name. Required only for the create and update action types. |
c |
Tag code. Required only for the create and update action types. |
tz |
Time zone. Optional. If the parameter isn’t specified, the time zone of the resource creator is set. |
f |
Flags. Optional. 0 by default. |
art |
Automatic reset timeout. Optional. 36000 (10 hours) by default. |
jp |
Custom fields in the "name":"value" format. Optional. If the parameter isn’t specified, the custom fields are cleared. |
Response
If the request for creating or editing the tag, or deleting its image, is completed successfully, the response is returned in the following format:
[
<long>, /* Tag ID. */
{
"id": <long>, /* Tag ID. */
"n": <text>, /* Name. */
"c": <text>, /* Code. */
"jp": { /* Custom fields. */
<text>: <text>, /* Name: value. */
...
},
"r": <double>, /* Image aspect ratio. */
"ck": <ushort>, /* Image checksum. */
"f": <ushort>, /* Flags, not currently used. 1 by default. */
"bu": <long>, /* Assigned unit. */
"pu": <long>, /* Previous assigned unit. */
"bt": <uint>, /* Last assignment/separation time. */
"tz": <int>, /* Time zone. */
"art": <uint>, /* Automatic reset timeout. */
"pos": { /* Location. */
"y": <double>, /* Latitude. */
"x": <double> /* Longitude. */
},
"ct": <uint>, /* Creation time (Unix timestamp). */
"mt": <uint> /* Last modification time (Unix timestamp). */
}
]
If the request for deleting the tag is completed successfully, the response is returned in the following format:
[
<long>, /* Tag ID. */
null
]
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters. For the update action type, this error is also returned if the tag with the specified ID doesn’t exist. |
| 6 | Undefined error. For the delete and reset_image action types, this error is also returned if the tag with the specified ID doesn’t exist. |
| 7 | The resource doesn’t exist, or the user doesn’t have the Create, edit, and delete passengers access right to it. |