update_round
To create, edit or delete rides, use the route/update_round method:
svc=route/update_round
params={
"itemId": <long>,
"id": <long>,
"callMode": <text>,
"n": <text>,
"d": <text>,
"u": <long>,
"at": <uint>,
"vt": <uint>,
"vp": <uint>,
"sh": <long>,
"cu": [<long>],
"f": <uint>,
"tz": <uint>
}
Parameters
The request must contain the following parameters:
Parameter | Description |
---|---|
itemID | Route ID. |
id | Ride ID. |
callMode | Action: create , update , delete . |
sh | Schedule ID. Required if the action is create or update . |
For the description of the other parameters, see get_round_data.
Response
If the request is completed successfully, the response format depends on the action specified in the callMode
parameter.
The response to the request for creating or updating a ride is returned in the following format:
[
<long>, // Ride ID.
{
"id": <long>, // Ride ID.
"ct": <long>, // Ride creation time (UNIX).
"mt": <long>, // Ride update time (UNIX).
"n": <text>, // Name.
"d": <text>, // Description.
"sh": <text>, // Schedule name.
"f": <uint>, // Ride flags.
"tz": <uint>, // Timezone.
"u": <long>, // Assigned unit. If not specified, this field shows the first unit from the "cu" array that departs from the first checkpoint.)
"at": <uint>, // Activation time.
"vt": <uint>, // Start of the validity period.
"vp": <uint>, // Validity period.
"sts": <uint>, // Ride state flags.
"st": { // Ride state.
"st": { // General ride state.
"pi": <uint>, // Checkpoint index (4294967295 if not started).
"ps": <uint>, // State flags and event flags.
"ut": <uint> // Last event time.
},
"pts": { // State by checkpoint.
"<checkpoint_id>": {
"st": <uint>, // Event flags.
"tm": <uint> // Last event time.
}
// ... additional checkpoints
}
}
}
]
Ride state and event flags are described on the get_round_data page.
The response to the request for deleting a ride is returned in the following format:
[
<long>, // Ride ID.
null
]
If the request fails, an error code is returned.
Error codes
Error code | Description |
---|---|
4 | One of the following errors:
|
6 | Internal error. |
7 | Internal error. |