Introduction
This set of Routing Engine API is a REST API, allowing you to easily integrate with other systems.
This page aims to explain the use of this set of Routing Engine API to plan your routes.
Any program capable of sending HTTP requests and parsing JSON is able to interact with our API.
This set of Routing Engine API is mainly for users with their own platform.
Plans created by this set of Routing Engine API are separate / independent from the dashboard, i.e. plans created by this API cannot be seen in the dashboard.
For interacting with the dashboard, refer to Dashboard API Documentation.
Pricing
Refer to Routing Engine API Pricing for the pricing.
API Key
This section is regarding the generation of the Application Programming Interface (API) Key.
- Click on the Settings at the top right hand corner.
- In the drop-down, click on Your Settings.
- Click on API.
- Provide a Token Name.
- A new window will appear with the API Key.
Keep it somewhere safe, as it will only be displayed once. If you lose this token, you will have to generate a new one.
Headers
You will need to set the following HTTP headers in all the API calls made to us:
- Set HTTP header ‘Content-Type‘ to ‘application/json‘.
Content-Type: application/json
- Set Custom HTTP header ‘Authorization‘ with your ElasticRoute API key.
Authorization: Bearer {YOUR_API_KEY}
Example:
Content-Type: application/json
Authorization: Bearer y05p5DOXcRAr3ZmaJflWpoNJacSIReWpOq9Hzy6UZKf3hXM3HrrOaHqqg72F
Request URL
You can post to the following end point for route planning and optimization:
POST https://app.elasticroute.com/api/v1/plan/{ plan_id }?c=sync&w=false
Parameters | Description | Type |
---|---|---|
plan_id | You can specify a unique id for the routing plan. The plan_id can be referenced later for retrieval of planned results. The results, referenced by each plan_id , can be overridden by a new API call made using the plan_id . Required. |
String |
c | This API call will perform the routing tasks in a queue. However, when c=sync is specified, the server will return the result synchronously. Please note that this option is only to be used on small number of stops/ jobs as the server will throw a timeout error after 60 seconds. Optional |
String |
w | Set true to trigger webhook after planning has been completed. Optional. Default: false (when c=sync ). Default: true (when c is not specified). |
Boolean |
Sample Request Body
{ "date": "2019-11-15", "stops": [ { "name": "SUTD", "address": "8 Somapah Road Singapore 487372", "lat": "1.3410211", "lng": "103.960695" }, { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": "1.3644202", "lng": "103.9893421" }, { "name": "Gardens By the Bay", "address": "18 Marina Gardens Drive Singapore 018953", "lat": "1.2815683", "lng": "103.8614245" }, { "name": "Singapore Zoo", "address": "80 Mandai Lake Road Singapore 729826", "lat": "1.4044825", "lng": "103.7898931" } ], "depots": [ { "name": "Main Warehouse", "lat": "1.3358054", "lng": "103.9102647" } ], "vehicles": [ { "name": "Van 1" }, { "name": "Van 2" } ], "rushHours": [], "generalSettings": { "country": "SG", "timezone": "Asia/Singapore" } }
Sample Response Body
{ "data": { "plan_id": "basic", "organization_name": "Detrack", "date": "2019-11-15", "details": { "stops": [ { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": 1.3644202, "lng": 103.9893421, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "run": 1, "sequence": 1, "eta": "2019-11-15T09:18:32.000000Z", "service_time": 0, "break_time": 0, "idle_time_from_previous_stop": 0, "time_from_previous_stop": 18.55, "distance_from_previous_stop": 12.6, "violations": [], "effects": ["Loading Time"], "time_to_end_depot": 0, "distance_to_end_depot": 0, "postal_code": null, "plan_zones": null, "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null, "exception": null, "exception_reason": null }, { "name": "SUTD", "address": "8 Somapah Road Singapore 487372", "lat": 1.3410211, "lng": 103.960695, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "run": 1, "sequence": 2, "eta": "2019-11-15T09:29:05.000000Z", "service_time": 0, "break_time": 0, "idle_time_from_previous_stop": 0, "time_from_previous_stop": 10.57, "distance_from_previous_stop": 6.28, "violations": [], "effects": [], "time_to_end_depot": 0, "distance_to_end_depot": 0, "postal_code": null, "plan_zones": null, "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null, "exception": null, "exception_reason": null }, { "name": "Gardens By the Bay", "address": "18 Marina Gardens Drive Singapore 018953", "lat": 1.2815683, "lng": 103.8614245, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "run": 1, "sequence": 3, "eta": "2019-11-15T09:50:07.000000Z", "service_time": 0, "break_time": 0, "idle_time_from_previous_stop": 0, "time_from_previous_stop": 21.04, "distance_from_previous_stop": 15.91, "violations": [], "effects": [], "time_to_end_depot": 0, "distance_to_end_depot": 0, "postal_code": null, "plan_zones": null, "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null, "exception": null, "exception_reason": null }, { "name": "Singapore Zoo", "address": "80 Mandai Lake Road Singapore 729826", "lat": 1.4044825, "lng": 103.7898931, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "run": 1, "sequence": 4, "eta": "2019-11-15T10:19:17.000000Z", "service_time": 0, "break_time": 0, "idle_time_from_previous_stop": 0, "time_from_previous_stop": 29.17, "distance_from_previous_stop": 22.01, "violations": [], "effects": [], "time_to_end_depot": 0, "distance_to_end_depot": 0, "postal_code": null, "plan_zones": null, "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null, "exception": null, "exception_reason": null } ], "depots": [ { "name": "Main Warehouse", "lat": 1.3358054, "lng": 103.9102647, "auto_select": false, "loading_time": 0, "unloading_time": 0, "address": null, "postal_code": null } ], "vehicles": [ { "name": "Van 1", "depot": "Main Warehouse", "end_depot": null, "priority": 10, "service_radius": null, "weight_capacity": null, "volume_capacity": null, "seating_capacity": null, "max_time": null, "max_distance": null, "max_stops": null, "max_time_per_day": null, "max_distance_per_day": null, "max_stops_per_day": null, "max_runs": null, "buffer": 40, "break_from": null, "break_till": null, "avail_from": 900, "avail_till": 1700, "vehicle_types": [ "Default" ], "return_to_depot": false }, { "name": "Van 2", "depot": "Main Warehouse", "end_depot": null, "priority": 10, "service_radius": null, "weight_capacity": null, "volume_capacity": null, "seating_capacity": null, "max_time": null, "max_distance": null, "max_stops": null, "max_time_per_day": null, "max_distance_per_day": null, "max_stops_per_day": null, "max_runs": null, "buffer": 40, "break_from": null, "break_till": null, "avail_from": 900, "avail_till": 1700, "vehicle_types": [ "Default" ], "return_to_depot": false } ], "rushHours": [], "generalSettings": { "country": "SG", "timezone": "Asia/Singapore", "depot_selection": "Default", "depot_selection_radius": null, "loading_time": null, "unloading_time": null, "buffer": null, "service_time": null, "distance_unit": null, "max_time": null, "max_distance": null, "max_stops": null, "max_time_per_day": null, "max_distance_per_day": null, "max_stops_per_day": null, "max_runs": null, "priority_value": "lower_lower", "use_dashboard_zones": false, "webhook_url": null, "geocoding_add_text": null, "release_preassign_to": false, "distribute_workload": false, "distribute_workload_type": null }, "zones": [] }, "stage": "planned", "stats": { "total_plan_stops": 4, "total_plan_depots": 1, "total_plan_vehicles": 1, "total_plan_distance": 56.8, "total_stops_served": 4, "total_exceptions": 0, "total_runs": 1, "total_plan_time": 0 }, "run_stats": [ { "run": 1, "start_time": "09:00", "end_time": "10:19", "total_distance": 56.8, "total_time": 78.75 } ], "progress": 100, "submitted": "2019-11-15 13:46:18", "planning": "2019-11-15 13:46:18", "planned": "2019-11-15 13:46:18" }, "attributes": { "organization_name": "Detrack" } }
- The above response with the planned results will be given with using the synchronous api call with parameter (
c=sync
) - Results can also be retrieved using the
plan_id
. Please refer to the other supporting api below.
API Fields And Description
Request
The JSON request for planning can be divided into 7 sections.
POST https://app.elasticroute.com/api/v1/plan/{ plan_id }?c=sync&w=false
The Required sections are Stops, Depot and Vehicles.
If not provided, the Date, General Settings and Rush Hour will take reference from the default values.
- Date Optional.
- Stops Required.
- Depot Required.
- Vehicles Required.
- General Settings Optional.
- Rush Hour Optional.
- Zones Optional.
-
Date for performing the job.
Fields Description Type date Date of the plan. Format: YYYY-MM-DD. Optional.
Default: Current date.String Sample Request Body
"date": "2019-11-15"
Sample Response Body
"date": "2019-11-15"
-
Information regarding the stops for route planning.
Array of
stop
objects. Required.Fields Description Type name Unique identifier of the stop. Required. Unique. String lat Latitude of the stop. Required if address is not given. Float lng Longitude of the stop. Required if address is not given. Float address Address of the stop. If lat
andlng
are not given, the address will be used for geocoding. Required iflat
andlng
are not given.String postal_code Postal code of the stop. If the country specified in the generalSettings is in 'SG' and lat and lng are not given, the postal code will be used for geocoding. Required if address, lat
andlng
are not given.String plan_zones Refer to the name of the zone that the stop was assigned to. Will only appear if the general_settings.use_dashboard_zones
is set to true.
Result.Array of String weight_load Weight load of the stop. Optional. Float volume_load Volume load of the stop. Optional. Float seating_load Seating load of the stop. Optional. Float service_time Additional service time (minutes) to be added to the stop. Optional.
Default: 0.Integer time_from_previous_stop Traveling time (mins) to reach the current stop from previous stop. Result. Integer distance_from_previous_stop Traveling distance to reach the stop. Distance between current and previous stop. Result. Float from The starting time window of the stop. Optional.
Default: 0900.Time till The ending time window of the stop. Optional.
Default: 1700.Time vehicle_type The stop is matched with the vehicle that tagged with the same name in the vehicle_types
field of the vehicles. Optional.
Default: “Default".String depot The name of one of the depot specified in the depot
s. The starting location where the driver would pickup the goods/ products to be delivered to the stop. Optional.
Default: First instance of the depot specified.String priority The priority of the stop. Stops of a higher priority value will be assigned to the vehicle first. Optional.
Default: 10.Integer preassign_to For use to assign the job to the vehicle
prior to planning. Optional.String assign_to The assigned driver to the stop after the planning. Result. String run The run number for the stop after planning. Result. Integer sequence The sequence where the stops should be visited in a given run. Result. Integer eta The estimated time of arrival of the driver to reach the stop. Result. Date/ Time blackout_from Start of blackout time to prevent systems from assigning Vehicle to stop. Generated eta
will be out of this time range.
Optional.Time blackout_till End of blackout time to prevent systems from assigning Vehicle to stop. Generated eta
will be out of this time range.
Optional.Time exception Display of errors. Unserved
: The stop cannot be served due to the time/ capacity limit of the drivers.Unmapped
: The stop cannot be geocoded. Result.String Sample Request
stops
Object"stops": [ { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": 1.3644202, "lng": 103.9893421, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "service_time": 0, "postal_code": null, "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null } ]
Sample Response
stops
Object"stops": [ { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": 1.3644202, "lng": 103.9893421, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "run": 1, "sequence": 1, "eta": "2019-11-15T09:18:33.000000Z", "service_time": 0, "time_from_previous_stop": 18.56, "distance_from_previous_stop": 12.82, "postal_code": null, "plan_zones": [], "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null, "exception": null } ]
-
Information regarding the depot (starting location) for the runs.
Array of
depot
objects. Required.Fields Description Type name Name of the depot. Required. Unique. String lat Latitude of the depot. Required if address is not given. Float lng Longitude of the depot. Required if address is not given. Float address Address of the depot. If lat and lng are not given, the address will be used for geocoding. Required if lat and lng are not given. String postal_code Postal code of the depot. If the country specified in the generalSettings is in “SG" and “lat" and “lng" are not provided, the postal code will be used for geocoding. Required if address, lat and lng are not given. String loading_time Time taken to load the goods at the depot. Will cause a delay before the vehicle moves off from this depot to the first stop. Optional. Integer unloading_time Time taken to unload the goods at the depot.
For use whengeneralSettings["reverse_direction"]
is set to “true".
Optional.Integer auto_select Indicates whether this depot can be selected for the automatic depot selection feature when the depot_selection
under general_settings is set toDynamic
orNearest
.
Default: falseBoolean Sample
depots
Request Object"depots": [ { "name": "Main Warehouse", "lat": 1.3358054, "lng": 103.9102647, "auto_select": false, "loading_time": 0, "address": "61 Kaki Bukit Avenue 1, Shun Li Industrial Park, 417943", "postal_code": 417943 } ]
Sample
depots
Response Object"depots": [ { "name": "Main Warehouse", "lat": 1.3358054, "lng": 103.9102647, "auto_select": false, "loading_time": 0, "address": "61 Kaki Bukit Avenue 1, Shun Li Industrial Park, 417943", "postal_code": 417943 } ]
-
Information regarding the vehicle/s to be used for planning.
Array of
vehicle
objects. Required.Fields Description Type name Unique identifier of the Vehicle. Required. Unique. String depot The name of the depot which is specified in the depots. Typically, it is the starting location of the place where the driver collect their goods from. Optional.
Default: First instance of the depot.String end_depot The name of the depot which is specified in the depots. Typically, it is the ending location where the driver ends their run. Optional.
Default: null.String buffer A modifier that affects the traveling speed of the vehicle. The higher the buffer, the slower the traveling speed. Optional. Integer priority The priority of the vehicle. Vehicles with higher priority will be assigned stops first. Optional.
Default: 10.Integer weight_capacity The weight capacity of the vehicle. If specified, the weight_load field of the stops will be considered for planning. Optional. Float volume_capacity The volume capacity of the vehicle. If specified, the volume_load field of the stops will be considered for planning. Optional. Float seating_capacity The seating capacity of the vehicle. If specified, the seating_capacity field of the stops will be considered for planning. Optional. Float avail_from The starting time where the vehicle is available. Optional.
Default: 900.Time avail_from The ending time where the vehicle is available. Optional.
Default: 1700.Time service_radius Vehicle will only serve stops within this radius (meters) of the selected depot. Optional. Integer break_from For break time use. Specify the time when the vehicle starts the break. Example: 1000. Optional.
Default: false.Time break_till For break time use. Specify the time when the vehicle starts the break. Default: false. Example: 1030. Optional.
Default: false.Time vehicle_types Only stops with the same vehicle_type
with the vehicle can be assigned to the driver. Optional.
Default: [ “Default" ].Array of Strings return_to_depot Specify whether the vehicle requires to return to the depot. The time taken to return to depot will be considered if this field is set to true. Optional.
Default: false.Boolean max_time The maximum allowable time for the vehicles per run. Optional. Integer max_distance The maximum allowable distance for the vehicles per run. Optional. Integer max_stops The maximum allowable stops for the vehicles to visit per run. Optional. Integer max_runs The maximum allowable runs per vehicle in a plan. Optional. Integer max_time_per_day The maximum time the vehicle will be allowed to work per day. Summation of max_time from all the runs for the vehicle. Optional. Integer max_distance_per_day The maximum distance the vehicle is allowed to travel per day. Summation of max_distance from all the runs for the vehicle. Optional. Integer max_stops_per_day The maximum number of stops the vehicle is allowed to perform per day. Summation of max_stops from all the runs for the vehicle. Optional. Integer zones For geofencing use.
Either:- Requires one to set up the zones in the dashboard prior to use.
Refer to How To Set Up Geofencing Of Stops.. - Provide the relevant
zones
object in the request payload.
Optional.
Array of Strings unzoned Refers to stops that are not within a zone.
Refer to How To Set Up Geofencing Of Stops.. Optional.Boolean Sample
vehicle
Request Object"vehicles": [ { "name": "Van 1", "depot": "Main Warehouse", "vehicle_types": [ "Default" ], "priority": 10, "service_radius": null, "break_from": null, "break_till": null, "buffer": 40, "avail_from": 900, "avail_till": 1700, "return_to_depot": false, "weight_capacity": null, "volume_capacity": null, "seating_capacity": null, "zones": [], "unzoned": false } ]
Sample
vehicle
Response Object"vehicles": [ { "name": "Van 1", "depot": "Main Warehouse", "vehicle_types": [ "Default" ], "priority": 10, "service_radius": null, "break_from": null, "break_till": null, "buffer": 40, "avail_from": 900, "avail_till": 1700, "return_to_depot": false, "weight_capacity": null, "volume_capacity": null, "seating_capacity": null, "zones": [], "unzoned": false } ]
- Requires one to set up the zones in the dashboard prior to use.
-
General settings for the run.
Run constraints.Fields Description Type country Country code for geocoding. Required. String timezone Time zone setting. Required. String distribute_workload Indicates whether the stops are meant to be split amongst the vehicles. Optional.
Default: falseBoolean distribute_workload_type Distribute the stops by either “time" or “stops".
time
– Systems try to compute total time to finish all the stops, and assign each vehicle based on an average max_time per run.stops
– Systems divide up the total number of stops, and assign each vehicle an average number of stops.- Values:
- time – Default
- stops
String loading_time Additional time to load goods/ products into vehicle before moving out from depot.Optional. Integer buffer Additional buffer time. If specified, additional buffer time will be added to each stop calculation. Percentage based calculation. Optional. Integer service_time Additional service time (minutes) to be added to the stop. This value will be used if the service_time is empty for a given stop. Optional.
Default: 0.Integer depot_selection For selection of the depot. Optional.
- Accepted values:
- Default – ElasticRoute will only take your provided
depot
in stops for planning. - Nearest – ElasticRoute will assign the nearest
depot
to your stops for planning, when the depot is not provided. - Dynamic – ElasticRoute will assign the
depot
based on the distance specified indepot_selection_radius
for planning.
Default: Default.
String priority_value lower-lower
will cause stops and vehicles with lowerpriority
of stops and vehicles to be assigned last.- Values:
- lower_lower – Default
- lower_higher
Refer to How To Reverse The Use Of Priority Values For Planning.
String depot_selection_radius Only applicable when depot_selection
is set to Dynamic. Distance is in meters. Optional.
Default: 0.Integer distance_unit The preferred unit used for distance calculation. Optional.
- Acceptable values:
- km
- miles
Default: km.
Integer max_time The maximum allowable time for the vehicles in their run. Optional. Integer max_distance The maximum allowable distance for the vehicles in their run. Optional. Integer max_stops The maximum allowable stops for the vehicles to visit in their run. Optional. Integer max_runs The maximum allowable runs in a plan. Optional. Integer max_time_per_day The maximum time the vehicle will be allowed to work per day. Summation of max_time from all the runs for the vehicle. Optional. Integer max_distance_per_day The maximum distance the vehicle is allowed to travel per day. Summation of max_distance from all the runs for the vehicle. Optional. Integer max_stops_per_day The maximum number of stops the vehicle is allowed to perform per day. Summation of max_stops from all the runs for the vehicle. Optional. Integer use_dashboard_zones To selecting whether to use the zone
setup in your dashboard. Optional.Boolean webhook_url The url used for webhook trigger. Optional. String release_preassign_to Allows the stops that are not pre-assigned to the vehicle to be assigned to it. Optional.
Default: false.Boolean reverse_direction The sytems will try to generate a path that prioritizes the furtherest stop back to depot
Optional.
If this value is set to “true", useunloading_time
underdepots
object. Optional
Default: false.Boolean Sample
generalSettings
Request Object"generalSettings": { "country": "SG", "timezone": "Asia/Singapore", "depot_selection": "Default", "depot_selection_radius": null, "priority_value": "lower_lower",
"reverse_direction": false, "loading_time": null, "buffer": null, "service_time": null, "distance_unit": null, "max_time": null, "max_distance": null, "max_stops": null, "max_runs": null, "webhook_url": null, "release_preassign_to": false }Sample
generalSettings
Response Object"generalSettings": { "country": "SG", "timezone": "Asia/Singapore", "depot_selection": "Default", "depot_selection_radius": null, "priority_value": "lower_lower", "reverse_direction": false, "loading_time": null, "buffer": null, "service_time": null, "distance_unit": null, "max_time": null, "max_distance": null, "max_stops": null, "max_runs": null, "webhook_url": null, "release_preassign_to": false }
-
Buffer time for stop-to-stop traveling time during certain timings.
Array of
rushHour
objects. Optional.Fields Description Type name Unique identifier. Required. Unique. Time from Starting time of the rush hour. E.g. 900. Required. Time till Ending time of the rush hour. E.g. 1700. Required. Time buffer Buffer time for the rush hour. Optional. Integer Sample
rushHours
Request Object"rushHours": [ { "name": "R1", "from": "0900", "till": "1000", "buffer": 10 } ]
Sample
rushHours
Response Object"rushHours": [ { "name": "R1", "from": "0900", "till": "1000", "buffer": 10 } ]
-
For use in geofencing to restrict vehicle to certain area / region.
Array of
zone
objects. Optional.Fields Description Type name Unique identifier of the zone
. Required. Unique.Time points Array of Latitudes and Longitudes that form the form of the Zone. Array of Objects lat Latitude of a zone boundary. Float lng Longitude of a zone boundary. Float Sample
rushHours
Request Object{ "zones": [ { "name": "East", "details": { "points": [ { "lat": 1.3975426423932216, "lng": 103.92620082836949 }, { "lat": 1.3472459812388682, "lng": 103.91040858033634 }, { "lat": 1.3261373777757879, "lng": 103.92534129910169 }, { "lat": 1.3089900916005817, "lng": 103.93650051011355 }, { "lat": 1.32786784281406, "lng": 103.98181910978748 }, { "lat": 1.3707712834318853, "lng": 104.00379176417485 }, { "lat": 1.3954833178485069, "lng": 103.99658198695397 } ] } }, { "name": "West", "details": { "points": [ { "lat": 1.3078018889813199, "lng": 103.61927183344955 }, { "lat": 1.3759053372112817, "lng": 103.65738176520233 }, { "lat": 1.3505066446317016, "lng": 103.77273671633672 }, { "lat": 1.3312858346812964, "lng": 103.79265317150856 }, { "lat": 1.2861780983728113, "lng": 103.7916435243088 }, { "lat": 1.284741677374196, "lng": 103.639785957348 }, { "lat": 1.2594055312840895, "lng": 103.61515662807486 }, { "lat": 1.3067721874842757, "lng": 103.61721684748751 } ] } } ] }
Response
Information regarding the planned information.
-
Array of
stop
objects.Fields Description Type assign_to The assigned vehicle
of thisstop
.String run The run
of thisstop
.Integer sequence The order to perform this stop
of the run.Integer eta Time to reach the stop
. Format: %Y-%m-%dT%H:%M:%S.%fZTime idle_time_from_previous_stop Time spent waiting before the vehicle
is serving thisstop
.Float time_from_previous_stop Journey time taken to reach this stop
from its predecessor.Float distance_from_previous_stop Distance taken to reach this stop
from its predecessor.Float violations Issues during manual sorting when it violates the planning criteria. Array of Strings effects Information related to planning. Array of Strings time_to_end_depot Time to reach the depot
from thisstop
.Float distance_to_end_depot Distance to reach the depot
from thisstop
.Float plan_zones zone
that thisstop
is being assigned to during planning.String exception Errors encountered during planning. Array of Strings exception_reason Errors encountered during planning. Array of Strings Sample Request
stops
Object"stops": [ { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": 1.3644202, "lng": 103.9893421, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "service_time": 0, "postal_code": null, "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null } ]
Sample Response
stops
Object"stops": [ { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": 1.3644202, "lng": 103.9893421, "depot": "Main Warehouse", "from": 900, "till": 1700, "vehicle_type": "Default", "priority": 10, "assign_to": "Van 2", "run": 1, "sequence": 1, "eta": "2019-11-15T09:18:33.000000Z", "service_time": 0, "time_from_previous_stop": 18.56, "distance_from_previous_stop": 12.82, "postal_code": null, "plan_zones": [], "weight_load": null, "volume_load": null, "seating_load": null, "preassign_to": null, "blackout_from": null, "blackout_till": null, "exception": null } ]
-
Information about the planning.
stat
objects. Optional.Fields Description Type total_plan_stops Total number of stops
in planning.Integer total_plan_depots Total number of depots
used in planning.Integer total_plan_vehicles Total number of vehicles
used in planning.Integer total_plan_distance Total distance of all the runs
.Float total_stops_served Total number of stops
planned.Integer total_exceptions Total number of exceptions
encountered during planning.Integer total_runs Total number of runs
generated.Integer total_plan_time Time taken to plan the run. Float Sample
stats
Response Object"stats":{ "total_plan_stops": 4, "total_plan_depots": 1, "total_plan_vehicles": 1, "total_plan_distance": 56.8, "total_stops_served": 4, "total_exceptions": 0, "total_runs": 1, "total_plan_time": 0 }
-
Provides information of each
run
.
Array ofrun_stat
objects.Fields Description Type run Run number integer start_time Start time of the run.
Format: HH:MMTime end_time End time of the run.
Format: HH:MMTime total_distance Total distance of the run. Float total_time Total run time of the run. (mins) Float Sample
run_stat
Request Object"run_stats": [ { "run": 1, "start_time": "09:00", "end_time": "10:19", "total_distance": 56.8, "total_time": 78.75 } ]
Logs
This section details the steps to retrieve the API logs.
- Log into your ElasticRoute account.
- Click on the profile icon at the top right corner.
- A drop-down will appear.
- Click on API Request Logs.
Other Supporting APIs
API | Description |
---|---|
GET https://app.elasticroute.com/api/v1/plan/{ plan_id } | Get the current status/ results of the plan specified by the plan_id . |
GET https://app.elasticroute.com/api/v1/plan/{ plan_id }/status | Get the current status of the plan specified by the plan_id . |
GET https://app.elasticroute.com/api/v1/plans | Get a list of plan results. |
POST https://app.elasticroute.com/api/v1/plan/{ plan_id }/stop | Stop the progress of the plan specified by the plan_id . |
DELETE https://app.elasticroute.com/api/v1/plan/{ plan_id } | Delete the plan specified by the plan_id . |
Start Routing Today!
Country Code
{ "AF": "Afghanistan", "AX": "Åland Islands", "AL": "Albania", "DZ": "Algeria", "AS": "American Samoa", "AD": "Andorra", "AO": "Angola", "AI": "Anguilla", "AQ": "Antarctica", "AG": "Antigua & Barbuda", "AR": "Argentina", "AM": "Armenia", "AW": "Aruba", "AU": "Australia", "AT": "Austria", "AZ": "Azerbaijan", "BS": "Bahamas", "BH": "Bahrain", "BD": "Bangladesh", "BB": "Barbados", "BY": "Belarus", "BE": "Belgium", "BZ": "Belize", "BJ": "Benin", "BM": "Bermuda", "BT": "Bhutan", "BO": "Bolivia", "BA": "Bosnia & Herzegovina", "BW": "Botswana", "BR": "Brazil", "IO": "British Indian Ocean Territory", "VG": "British Virgin Islands", "BN": "Brunei", "BG": "Bulgaria", "BF": "Burkina Faso", "BI": "Burundi", "KH": "Cambodia", "CM": "Cameroon", "CA": "Canada", "IC": "Canary Islands", "CV": "Cape Verde", "BQ": "Caribbean Netherlands", "KY": "Cayman Islands", "CF": "Central African Republic", "EA": "Ceuta & Melilla", "TD": "Chad", "CL": "Chile", "CN": "China", "CX": "Christmas Island", "CC": "Cocos (Keeling) Islands", "CO": "Colombia", "KM": "Comoros", "CG": "Congo - Brazzaville", "CD": "Congo - Kinshasa", "CK": "Cook Islands", "CR": "Costa Rica", "CI": "Côte d’Ivoire", "HR": "Croatia", "CU": "Cuba", "CW": "Curaçao", "CY": "Cyprus", "CZ": "Czechia", "DK": "Denmark", "DG": "Diego Garcia", "DJ": "Djibouti", "DM": "Dominica", "DO": "Dominican Republic", "EC": "Ecuador", "EG": "Egypt", "SV": "El Salvador", "GQ": "Equatorial Guinea", "ER": "Eritrea", "EE": "Estonia", "ET": "Ethiopia", "FK": "Falkland Islands", "FO": "Faroe Islands", "FJ": "Fiji", "FI": "Finland", "FR": "France", "GF": "French Guiana", "PF": "French Polynesia", "TF": "French Southern Territories", "GA": "Gabon", "GM": "Gambia", "GE": "Georgia", "DE": "Germany", "GH": "Ghana", "GI": "Gibraltar", "GR": "Greece", "GL": "Greenland", "GD": "Grenada", "GP": "Guadeloupe", "GU": "Guam", "GT": "Guatemala", "GG": "Guernsey", "GN": "Guinea", "GW": "Guinea-Bissau", "GY": "Guyana", "HT": "Haiti", "HN": "Honduras", "HK": "Hong Kong", "HU": "Hungary", "IS": "Iceland", "IN": "India", "ID": "Indonesia", "IR": "Iran", "IQ": "Iraq", "IE": "Ireland", "IM": "Isle of Man", "IL": "Israel", "IT": "Italy", "JM": "Jamaica", "JP": "Japan", "JE": "Jersey", "JO": "Jordan", "KZ": "Kazakhstan", "KE": "Kenya", "KI": "Kiribati", "XK": "Kosovo", "KW": "Kuwait", "KG": "Kyrgyzstan", "LA": "Laos", "LV": "Latvia", "LB": "Lebanon", "LS": "Lesotho", "LR": "Liberia", "LY": "Libya", "LI": "Liechtenstein", "LT": "Lithuania", "LU": "Luxembourg", "MO": "Macau", "MK": "Macedonia", "MG": "Madagascar", "MW": "Malawi", "MY": "Malaysia", "MV": "Maldives", "ML": "Mali", "MT": "Malta", "MH": "Marshall Islands", "MQ": "Martinique", "MR": "Mauritania", "MU": "Mauritius", "YT": "Mayotte", "MX": "Mexico", "FM": "Micronesia", "MD": "Moldova", "MC": "Monaco", "MN": "Mongolia", "ME": "Montenegro", "MS": "Montserrat", "MA": "Morocco", "MZ": "Mozambique", "MM": "Myanmar (Burma)", "NA": "Namibia", "NR": "Nauru", "NP": "Nepal", "NL": "Netherlands", "NC": "New Caledonia", "NZ": "New Zealand", "NI": "Nicaragua", "NE": "Niger", "NG": "Nigeria", "NU": "Niue", "NF": "Norfolk Island", "KP": "North Korea", "MP": "Northern Mariana Islands", "NO": "Norway", "OM": "Oman", "PK": "Pakistan", "PW": "Palau", "PA": "Panama", "PG": "Papua New Guinea", "PY": "Paraguay", "PE": "Peru", "PH": "Philippines", "PN": "Pitcairn Islands", "PL": "Poland", "PT": "Portugal", "PR": "Puerto Rico", "QA": "Qatar", "RE": "Réunion", "RO": "Romania", "RU": "Russia", "RW": "Rwanda", "WS": "Samoa", "SM": "San Marino", "ST": "São Tomé & Príncipe", "SA": "Saudi Arabia", "SN": "Senegal", "RS": "Serbia", "SC": "Seychelles", "SL": "Sierra Leone", "SG": "Singapore", "SX": "Sint Maarten", "SK": "Slovakia", "SI": "Slovenia", "SB": "Solomon Islands", "SO": "Somalia", "ZA": "South Africa", "GS": "South Georgia & South Sandwich Islands", "KR": "South Korea", "SS": "South Sudan", "ES": "Spain", "LK": "Sri Lanka", "BL": "St. Barthélemy", "SH": "St. Helena", "KN": "St. Kitts & Nevis", "LC": "St. Lucia", "MF": "St. Martin", "PM": "St. Pierre & Miquelon", "VC": "St. Vincent & Grenadines", "SD": "Sudan", "SR": "Suriname", "SJ": "Svalbard & Jan Mayen", "SZ": "Swaziland", "SE": "Sweden", "CH": "Switzerland", "SY": "Syria", "TW": "Taiwan", "TJ": "Tajikistan", "TZ": "Tanzania", "TH": "Thailand", "TL": "Timor-Leste", "TG": "Togo", "TK": "Tokelau", "TO": "Tonga", "TT": "Trinidad & Tobago", "TN": "Tunisia", "TR": "Turkey", "TM": "Turkmenistan", "TC": "Turks & Caicos Islands", "TV": "Tuvalu", "UM": "U.S. Outlying Islands", "VI": "U.S. Virgin Islands", "UG": "Uganda", "UA": "Ukraine", "AE": "United Arab Emirates", "GB": "United Kingdom", "US": "United States", "UY": "Uruguay", "UZ": "Uzbekistan", "VU": "Vanuatu", "VA": "Vatican City", "VE": "Venezuela", "VN": "Vietnam", "WF": "Wallis & Futuna", "EH": "Western Sahara", "YE": "Yemen", "ZM": "Zambia", "ZW": "Zimbabwe" }
Timezones
{ "list": [ "Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Costa_Rica", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Atyrau", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Chita", "Asia/Choibalsan", "Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kathmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qyzylorda", "Asia/Riyadh", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ulaanbaatar", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faroe", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/Perth", "Australia/Sydney", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Busingen", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Saratov", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Wake", "Pacific/Wallis", "UTC" ] }