update_retranslation_property
To update the retranslation properties of a unit, use the unit/update_retranslation_property method.
svc=unit/update_retranslation_property¶ms={
"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:
|
| 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:
{
"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.
https://hst-api.wialon.com/wialon/ajax.html?svc=unit/update_retranslation_property¶ms={"itemId":814743,"route_data":{"vehicle_type":"bus","route":"112A"}}&sid=SESSION_IDENTIFIER
The response is as follows.
{
"vehicle_type": "bus",
"route": "112A"
}