update_retranslation_property

To update the retranslation properties of a unit, use the unit/update_retranslation_property method.

Copied!
svc=unit/update_retranslation_property&params={
  "itemId": <long>,
  "route_data": {
    "vehicle_type": <text>,
    "route": <text>
  }
}

Parameters

The request must contain the following parameters:

Parameter Description
itemId Unit ID.
route_data Object with route parameters.
vehicle_type Type of vehicle. Possible values:
  • bus
  • trolleybus
  • tramway
  • minibus
  • tram
  • route taxi
route Route name. It can’t be empty and can’t contain the ' and ` characters.

All the parameters are required.

Response

If the request is completed successfully, the saved route data is returned in the following format:

Copied!
{
  "vehicle_type": <text>,
  "route": <text>
}

Otherwise, an error code is returned.

The saved data is also available in the retr field of the unit advanced properties (flag 0x00000100).

Error codes

Error code Description
4 Wrong input parameters: a parameter is missing, the route name is empty or contains a restricted character, or the vehicle type isn’t one of the listed values.
6 Failed to update parameters.
7 No Edit not mentioned properties access right to the unit.

Example

The following request sets the bus route for the unit with the ID 814743.

Copied!
https://hst-api.wialon.com/wialon/ajax.html?svc=unit/update_retranslation_property&params={"itemId":814743,"route_data":{"vehicle_type":"bus","route":"112A"}}&sid=SESSION_IDENTIFIER

The response is as follows.

Copied!
{
  "vehicle_type": "bus",
  "route": "112A"
}

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