Skip to content

Tour Commander API (1.0.0)

Part of Bettermile Route API responsible for tour management

Languages
Servers
Dev API

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

Operations

Request

Security
ApiKeyAuth
Bodyapplication/jsonrequired
datestring(date)required

Date on which the tour is / will be driven. Must not be in the past

assignmentstring[ 1 .. 128 ] charactersrequired

Vehicle / route / driver identifier. This value is used to look up jobs in Data Gateway

depotstring[ 1 .. 128 ] charactersrequired

Depot identifier

depotIsDestinationboolean

Whether to use depot address as the destination for the tour.

Default false
curl -i -X POST \
  https://dev.routes.bettermile.com/v1/tours \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "date": "2019-08-24",
    "assignment": "string",
    "depot": "string"
  }'

Responses

Tour has been successfully created

Bodyapplication/json
dataobject(TourCreated)

Output from tour creation

Response
application/json
{ "data": { "tourId": "eb2f92e7-0760-4174-a0f6-c120b0ef2ec8" } }

Get tours for a given date, optionally narrowed down by a given assignment value

Request

Security
ApiKeyAuth
Query
datestring(date)required
assignmentstring
curl -i -X GET \
  'https://dev.routes.bettermile.com/v1/tours?date=2019-08-24' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

List of tours matching the provided criteria

Bodyapplication/json
dataArray of objects(TourList)

List of tours.

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

Request

Security
ApiKeyAuth
Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

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

Responses

Full tour information, excluding the current sequence

Bodyapplication/json
dataobject(Tour)
Response
application/json
{ "data": { "tourId": "eb2f92e7-0760-4174-a0f6-c120b0ef2ec8", "date": "2019-08-24", "assignment": "string", "depot": "string", "created": "2019-08-24T14:15:22Z", "jobs": [], "waypoints": [], "rttCategory": "GOOD", "destination": {}, "unassignedJobIdentifiers": [] } }

Request

Security
ApiKeyAuth
Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

Bodyapplication/jsonrequired
latnumber(double)[ -90 .. 90 ]required

Latitude

lonnumber(double)[ -180 .. 180 ]required

Longitude

countrystring or null

Country as "alpha-2 code" of ISO 3166 (https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). If this value is not provided, the country of the depot that this tour belongs to will be used.

curl -i -X PUT \
  'https://dev.routes.bettermile.com/v1/tours/{tourId}/destination' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "lat": -90,
    "lon": -180
  }'

Responses

Tour destination has been set successfully

Bodyapplication/json
dataobject
Example: {}
Response
application/json
{ "data": {} }

Get potential recalculation gain for tour

Request

Get potential recalculation gain for tour. Recommended for tours with “fixed” and “use provided” optimization only

Security
ApiKeyAuth
Path
tourIdstring(uuid)required

Unique tour identifier (generated by Better Route backend)

Query
latnumber(double)required
lonnumber(double)required
curl -i -X GET \
  'https://dev.routes.bettermile.com/v1/tours/{tourId}/potential-recalc-gain?lat=0.1&lon=0.1' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Potential recalculation gain - how much time can be saved after tour recalculation.

Bodyapplication/json
dataobject(PotentialRecalcGainResponse)

Result of requesting for potential recalculation gain

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

Sequence

Operations on the sequence level

Operations

Waypoint

Operations on the waypoint level

Operations
Operations

Custom Job

Operations on custom jobs

Operations

Custom Waypoint

Operations on custom waypoints

Operations