/api/plantour3
Optimise the order of the stops of a tour. Requires the geo tool permission or wpass, and the tourapi option.
Change Note: metres driven to each stop and back to the start; errors as HTTP status instead of a status text
Parameters
| Name | Description | Type |
|---|---|---|
| aid | comma separated address ids; the first is the start, repeat it as last for a round trip, otherwise the last is where the tour ends | string |
| cid | comma separated customer ids, alternative to aid | string |
| did | ride (ddate id), alternative to aid and cid: the stops of that ride as dtour has them (in dtour sequence) are planned as a round trip from the shop location, which is stop -1 in the result; the tid is taken from the ride | int |
| persist | with did: 1/true writes the planned sequence back into the ride (dtour.inx); the planned metres and minutes per stop are kept in tourstats either way | boolean |
| tid | tour the stops belong to; the planned metres and minutes per stop are kept either way and show as the distance of the deliveries (api/tour34), the tid is stored with them. Without aid, cid and did, all delivery addresses of that tour (active customers, visible, geocoded) are planned as a round trip from the shop location, which is stop -1 in the result | int |
| start | departure at the first stop (yyyy-MM-dd'T'HH:mm:ssX); switches on planning with the time frames of the stops | datetime |
| wpass | PCG passphrase, alternative to a logged in operator | string |
| oo-rf | optionally define the response-format for this call. One of: compact (default) | compacts | full | fulls | json | md | html | js | openapi | yaml | String |
| oo-auth | optionally force the API to check against the role (instead of silently not returning data). For guests or public access, the default is -1. 0 (regular customer) and above define the role for which the current session is expected to be authorized. | int |
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 403 | AUTHERROR | No permission |
| 409 | DISABLED | The tourapi option is off |
| 404 | noride | did given, but there is no ride (ddate) with that id |
| 409 | allbad | None of the ids has a usable geo position and address, the ride has no dtour stops, or the tour has no plannable address |
| 409 | planerror | The routing provider failed or could not plan the tour |
| 409 | noparams | Neither aid, cid, did nor tid given |
| 409 | error | aid or cid is not a comma separated list of ids |
Response Types
| Type | Version | Description |
|---|---|---|
| TourPlan | 3 | Optimised order of the stops of a tour |
OpenAPI
See plantour3.yaml
Other versions
- /api/plantour4 (newer)