Tour Commander API (1.0.0)

Part of Bettermile Route API responsible for tour management

Languages
Servers
Dev API

https://dev.routes.bettermile.com/

Tour

Operations on the tour level

Operations

Sequence

Operations on the sequence level

Operations

Request creation of a new sequence

Request

Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

Bodyapplication/jsonrequired
modestring(SequenceCreationMode)required

Mode which is used to create a sequence:

  • FIXED_OPTIMIZATION instructs that ETAs of waypoints are to be re-calculated, while the order of the waypoints is mostly kept intact (waypoint may only be moved in certain special cases, like when the time frame changes for a waypoint)
  • FULL_OPTIMIZATION instructs the backend to create an entirely new sequence, without attempts to maintain the previous order of waypoints
  • RETURN_TO_PREVIOUS_WAYPOINT_ORDER can be used to return to a previously used order of waypoints, in a situation when results of running FULL_OPTIMIZATION need to be "undone"
  • USE_PROVIDED instructs the backend to keep the order of the provided waypoint ids (time frames will be ignored)
Enum"FIXED_OPTIMIZATION""FULL_OPTIMIZATION""RETURN_TO_PREVIOUS_WAYPOINT_ORDER""USE_PROVIDED"
coordsobject(Coordinates)required

A pair of coordinates

coords.​latnumber(double)

Latitude

coords.​lonnumber(double)

Longitude

startTimestring(time)required
Example: "08:00:00"
waypointIdsArray of strings(uuid)

List of waypoints IDs representing expected order of waypoints in the generated sequence. When provided, sequence creation mode must be 'USE_PROVIDED'.

firstWaypointIdstring(uuid)

ID of the waypoint which must become first in the generated sequence. When provided, sequence creation mode must be 'FULL_OPTIMIZATION'.

curl -i -X POST \
  'https://dev.routes.bettermile.com/v1/tours/{tourId}/sequences' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "mode": "FIXED_OPTIMIZATION",
    "coords": {},
    "startTime": "08:00:00"
  }'

Responses

Sequence creation has been successfully initiated

Bodyapplication/json
dataobject(SequenceCreated)

Output from sequence creation

Response
application/json
{ "data": { "sequenceId": 0 } }

Get sequences for a given tour, ordered from newest to oldest

Request

Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

curl -i -X GET \
  'https://dev.routes.bettermile.com/v1/tours/{tourId}/sequences' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

List of sequences, created for a given tour

Bodyapplication/json
dataArray of objects(SequenceList)

List of sequences.

Response
application/json
{ "data": [ {} ] }

Get latest generated sequence for a given tour

Request

Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

curl -i -X GET \
  'https://dev.routes.bettermile.com/v1/tours/{tourId}/sequences/latest' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Full sequence information, including open, closed and unassigned waypoints

Bodyapplication/json
dataobject(Sequence)

Basic information about a sequence, excluding waypoints

Response
application/json
{ "data": { "sequenceId": 0, "mode": "FIXED_OPTIMIZATION", "coords": {}, "startTime": "14:15:22Z", "sequenceIdWithPreviousWaypointOrder": 0, "created": "2019-08-24T14:15:22Z", "sequenceFidelity": 1, "destination": {}, "openWaypoints": [], "closedWaypoints": [], "unassignedWaypoints": [] } }

Get a sequence by ID

Request

Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

sequenceIdinteger(int64)required

Unique sequence identifier (generated by Better Route backend)

curl -i -X GET \
  'https://dev.routes.bettermile.com/v1/tours/{tourId}/sequences/{sequenceId}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Full sequence information, including open, closed and unassigned waypoints

Bodyapplication/json
dataobject(Sequence)

Basic information about a sequence, excluding waypoints

Response
application/json
{ "data": { "sequenceId": 0, "mode": "FIXED_OPTIMIZATION", "coords": {}, "startTime": "14:15:22Z", "sequenceIdWithPreviousWaypointOrder": 0, "created": "2019-08-24T14:15:22Z", "sequenceFidelity": 1, "destination": {}, "openWaypoints": [], "closedWaypoints": [], "unassignedWaypoints": [] } }

Waypoint

Operations on the waypoint level

Operations

Job

Operations on the job level

Operations

Custom Job

Operations on custom jobs

Operations

Custom Waypoint

Operations on custom waypoints

Operations