Connect with our team:
Join with Slack Connect:
Open Slack
Join with Telegram:
Open Telegram
Or reach us here:
E-mail, contact form, phone

Routing API (v1)

Authentication

Bearer

All requests to the API must be authorized with user's API key. The API uses HTTP Bearer authorization scheme.The API key must be provided in HTTP headers in one of the following formats:

Authorization: Bearer <your API key>
Authorization: Apikey <your API key>```

Routing operations

Submit routing request

Endpoint:HTTP post /api/routing/v1/add
Authorization:
Body:application/json
object
fleet
required
VehiclesDictionary, object

Fleet of available vehicles to visit sites.

sites
required
SitesDictionary, object

Sites to be visited.

depot
deprecated
DeprecatedDepot, object

Depot where all vehicles start and optionally finish their routes.

depots
DepotsDictionary, object

Depots where vehicles start and finish routes.

options
Options, object

Route optimization options.

constraints
Constraints, object

Constraints applied to all vehicles in the fleet or to all defined sites

Responses

Status:HTTP 200

Task has been queued for execution.

Response headers:
Location
string

URL to poll for task completion.

Response body:application/json
object
id
required
string

Task unique id

status
required
string
enum: created | started | completed | cancelled

Current status of an asynchronous task.

Status values:

  • created - request JSON has been parsed and validated, and task was created;
  • started - task execution has started;
  • completed - task execution has been completed;
  • cancelled - task execution has been cancelled due to timeout or error.

The status of a task will change only in the following ways during execution:

  • created ⟶ cancelled;
  • created ⟶ started ⟶ (completed or cancelled).
status_log
required
StatusLogEntry, array< object >

Task status log

Status:HTTP 400

Invalid or empty JSON in POST request body

Status:HTTP 401

Request is not authorized

Status:HTTP 500

Server error during request processing

Receive routing result

Endpoint:HTTP get /api/routing/v1/result/{id}
Authorization:
Path parameters:
id
required
string <byte> 22 characters

Task ID to query

Responses

Status:HTTP 200

Task execution completed

Response body:application/json
oneOf<ResultResponse | ErrorResponse>
oneOf
  • ResultResponse
  • ErrorResponse
result
required
RouteOptimizationSolution, object

Optimized routes

id
required
string

Task unique id

status
required
string
enum: created | started | completed | cancelled

Current status of an asynchronous task.

Status values:

  • created - request JSON has been parsed and validated, and task was created;
  • started - task execution has started;
  • completed - task execution has been completed;
  • cancelled - task execution has been cancelled due to timeout or error.

The status of a task will change only in the following ways during execution:

  • created ⟶ cancelled;
  • created ⟶ started ⟶ (completed or cancelled).
status_log
required
StatusLogEntry, array< object >

Task status log

Status:HTTP 202

Task is executing

Status:HTTP 401

Request is not authorized

Status:HTTP 404

Requested task is not found.

Status:HTTP 500

Server error during request processing

Service operations

API endpoints for development, monitoring and maintenance

OpenAPI 3.0 schema

Responses

Status:HTTP 200

OK

Response body:application/json
object

Status and availability

Provides information in service avialability and status

Endpoint:HTTP get /api/routing/v1/ping

Responses

Status:HTTP 200

Service is available

Response body:application/json
object
status
string
value: OK

Documentation

API documentation in HTML format

Endpoint:HTTP get /api/routing/v1/doc

Responses

Status:HTTP 200

OK

Response body:text/html
string
string
(c) 2023 Routinghub LLC