Bettermile Tour Commander API (1.0.0)

Download OpenAPI specification:Download

Part of Bettermile Route API responsible for tour management

Tour

Operations on the tour level

Request creation of a new tour

SecurityApiKeyAuth
Request
Request Body schema: application/json
date
required
string <date>

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

assignment
required
string [ 1 .. 128 ] characters

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

depot
required
string [ 1 .. 128 ] characters

Depot identifier

depotIsDestination
boolean
Default: false

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

Responses
200

Tour has been successfully created

400

Error response returned when the request is invalid. In most cases this implies that some data in the request is either missing or has incorrect format.

401

Error response returned when the provided API key is missing or invalid

500

Error response returned whenever the server fails to process the request

post/v1/tours
Request samples
application/json
{
  • "date": "2019-08-24",
  • "assignment": "string",
  • "depot": "string",
  • "depotIsDestination": false
}
Response samples
application/json
{
  • "data": {
    }
}

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

SecurityApiKeyAuth
Request
query Parameters
date
required
string <date>
assignment
string
Responses
200

List of tours matching the provided criteria

400

Error response returned when the request is invalid. In most cases this implies that some data in the request is either missing or has incorrect format.

401

Error response returned when the provided API key is missing or invalid

500

Error response returned whenever the server fails to process the request

get/v1/tours
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

Get tour by ID

SecurityApiKeyAuth
Request
path Parameters
tourId
required
string <uuid>

Unique tour identifier (generated by Better Route backend)

Responses
200

Full tour information, excluding the current sequence

400

Error response returned when the request is invalid. In most cases this implies that some data in the request is either missing or has incorrect format.

401

Error response returned when the provided API key is missing or invalid

404

Error response returned in cases the requested endpoint or data can't be found

500

Error response returned whenever the server fails to process the request

get/v1/tours/{tourId}
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Set tour destination

SecurityApiKeyAuth
Request
path Parameters
tourId
required
string <uuid>

Unique tour identifier (generated by Better Route backend)

Request Body schema: application/json
country
string 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.

lat
required
number <double> [ -90 .. 90 ]

Latitude

lon
required
number <double> [ -180 .. 180 ]

Longitude

Responses
200

Tour destination has been set successfully

400

Error response returned when the request is invalid. In most cases this implies that some data in the request is either missing or has incorrect format.

401

Error response returned when the provided API key is missing or invalid

404

Error response returned in cases the requested endpoint or data can't be found

500

Error response returned whenever the server fails to process the request

put/v1/tours/{tourId}/destination
Request samples
application/json
{
  • "country": "string",
  • "lat": -90,
  • "lon": -180
}
Response samples
application/json
{
  • "data": { }
}

Get potential recalculation gain for tour

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

SecurityApiKeyAuth
Request
path Parameters
tourId
required
string <uuid>

Unique tour identifier (generated by Better Route backend)

query Parameters
lat
required
number <double>
lon
required
number <double>
Responses
200

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

400

Error response returned when the request is invalid. In most cases this implies that some data in the request is either missing or has incorrect format.

401

Error response returned when the provided API key is missing or invalid

404

Error response returned in cases the requested endpoint or data can't be found

409

Error response returned in case operation will result in incorrect state of the resource

429

Error response returned in case operation encounter rate limi

500

Error response returned whenever the server fails to process the request

get/v1/tours/{tourId}/potential-recalc-gain
Request samples
Response samples
application/json
{
  • "data": {
    }
}