Dashboard API Documentation

Introduction

ElasticRoute is served on via HTTP REST API, allowing you to integrate other systems with ElasticRoute easily. This page aims to explain how to use our API to plan your routes.

Any program capable of sending HTTP requests and parsing JSON is able to interact with our API.

Requests created through the following API will interact with your ElasticRoute dashboard.

API Key

You need to obtain an API Key before you can use the ElasticRoute API. First, provide a name for the new API Key under Settings > API:

A new window will appear display the API Key. Keep it somewhere safe, as it will only be displayed once. If you lose this token, you must delete this and generate a new one.

You will need to set the following HTTP headers in all the API calls made to us:

1. Set HTTP header ‘Content-Type‘ to ‘application/json‘.

Content-Type: application/json

2. Set Custom HTTP header ‘Authorization‘ with your ElasticRoute API key.

Authorization: Bearer {YOUR_API_KEY}

Example:
Content-Type: application/json
Authorization: Bearer y05p5DOXcRAr3ZmaJflWpoNJacSIReWpOq9Hzy6UZKf3hXM3HrrOaHqqg72F

API Section

There are 3 sections to interact with the ElasticRoute dashboard.

API Description
Section Description
Vehicles For performing the Create, Read, Update and Delete (CRUD) of vehicles.
Stops For performing the Create, Read, Update and Delete (CRUD) of stops.
Stops Planning For starting or stopping the planning of your stops.

Vehicles

This section is for performing the Create, Read, Update and Delete (CRUD) of vehicles.

Stops

This section is for performing the Create, Read, Update and Delete (CRUD) of stops.

Stops Planning

This section is for starting and stopping the planning process.

Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
Format of {date}: “YYYY-MM-DD" e.g. 2019-06-01

List Of Endpoints
Method {endpoint} Example Description
POST stops/{date}/plan https://app.elasticroute.com/api/v1/account/stops/2019-06-01/plan To start the planning process.
POST stops/{date}/plan/stop https://app.elasticroute.com/api/v1/account/stops/2019-06-01/plan/stop To stop the planning process.
(Valid only if there is a planning in progress.)
GET stops/{date}/plan/status https://app.elasticroute.com/api/v1/account/stops/2019-06-01/plan/status To check the progress of the plan.

GET https://app.elasticroute.com/api/v1/account/stops/{date}/plan/status

Example: https://app.elasticroute.com/api/v1/account/stops/2019-10-01/plan/status
The progress key will indicate the percentage of the planning progress. Min: 0 Max: 100.

Sample Response Body
{
  "data": {
    "date": "2019-10-01",
    "details": {
      "stops": [
        {
          "vehicle_type": null,
          "depot": null,
          "name": "Stop1",
          "address": "Junction 11",
          "postal_code": null,
          "weight_load": null,
          "volume_load": null,
          "seating_load": null,
          "service_time": 0,
          "priority": 10,
          "preassign_to": null,
          "assign_to": "Vehicle 1",
          "run": 1,
          "sequence": 1,
          "eta": 953,
          "lat": 1.31246,
          "lng": 103.86427,
          "exception": null
        },
        {
          "vehicle_type": null,
          "depot": null,
          "name": "Stop2",
          "address": "Junction 10",
          "postal_code": null,
          "weight_load": null,
          "volume_load": null,
          "seating_load": null,
          "service_time": 0,
          "priority": 10,
          "preassign_to": null,
          "assign_to": "Vehicle 1",
          "run": 1,
          "sequence": 2,
          "eta": 1013,
          "lat": 1.3803675,
          "lng": 103.7601674,
          "exception": null
        },
        {
          "vehicle_type": null,
          "depot": null,
          "name": "Stop3",
          "address": "Junction 9",
          "postal_code": null,
          "weight_load": null,
          "volume_load": null,
          "seating_load": null,
          "service_time": 0,
          "priority": 10,
          "preassign_to": null,
          "assign_to": "Vehicle 1",
          "run": 3,
          "sequence": 1,
          "eta": 1045,
          "lat": 1.31246,
          "lng": 103.86427,
          "exception": null
        }
      ],
      "zones": [],
      "depots": [
        {
          "name": "Depot 1",
          "address": "Dummy Address 1",
          "lat": null,
          "lng": null,
          "loading_time": null,
          "auto_select": true
        }
      ],
      "vehicles": [
        {
          "depot": "Depot 1",
          "name": "Vehicle 1",
          "priority": 10,
          "service_radius": null,
          "weight_capacity": null,
          "volume_capacity": null,
          "seating_capacity": null,
          "buffer": null,
          "avail_from": 900,
          "avail_till": 1700,
          "return_to_depot": true,
          "break_from": null,
          "break_till": null,
          "vehicle_types": [
            "Default"
          ]
        }
      ],
      "rushHours": [],
      "generalSettings": {
        "country": "SG",
        "timezone": "Asia/Singapore",
        "loading_time": 10,
        "buffer": 20,
        "service_time": 10,
        "depot_selection": "Default",
        "depot_selection_radius": 100000,
        "distance_unit": "km",
        "max_time": null,
        "max_distance": null,
        "max_stops": null,
        "max_runs": null,
        "webhook_url": null
      }
    },
    "stops": 3,
    "stage": "planned",
    "progress": 100,
    "submitted": "2019-10-03 17:17:18",
    "planning": "2019-10-03 17:17:27",
    "planned": null
  }
}