/api/plantour4

Optimise the order of the stops of a tour, or calculate a given sequence. Requires the geo tool permission or wpass, and the tourapi option.

Change Note: opt=no calculates the given sequence without optimising; before_* fields with the metres and hours of the given sequence for comparison (aid, cid and did calls)

Parameters

(string) 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) comma separated customer ids, alternative to aid
(int) 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🔗 ddate_id
(boolean) 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
(string) no: do not optimise, only calculate the metres and minutes of the sequence as given (status CALCULATED, no before_* fields)
(int) 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🔗 tour_id
(datetime) departure at the first stop (yyyy-MM-dd'T'HH:mm:ssX); switches on planning with the time frames of the stops
(string) PCG passphrase, alternative to a logged in operator
(String) optionally define the response-format for this call. One of: compact (default) | compacts | full | fulls | json | md | html | js | openapi | yaml
(int) 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.

Error Responses

HTTP StatusError CodeDescription
403AUTHERRORNo permission
409DISABLEDThe tourapi option is off
404noridedid given, but there is no ride (ddate) with that id
409allbadNone of the ids has a usable geo position and address, the ride has no dtour stops, or the tour has no plannable address
409planerrorThe routing provider failed or could not plan the tour
409noparamsNeither aid, cid, did nor tid given
409erroraid or cid is not a comma separated list of ids

Response Types