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
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:
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
The API is being divided into 4 main sections.
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. |
Time Windows | For performing the Create Read, Update and Delete (CRUD) of Time Windows. |
Vehicles
This section is for performing the Create, Read, Update and Delete (CRUD) of vehicles, corresponding to Settings > Vehicles of your ElasticRoute account.
-
Single Vehicle
Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
List Of Endpoints Method {endpoint} Example Description GET vehicles/{name} https://app.elasticroute.com/api/v1/account/vehicles/vehicle1 For retrieving information of name of “vehicle1". POST vehicles https://app.elasticroute.com/api/v1/account/vehicles For creating vehicle. PUT vehicles/{name} https://app.elasticroute.com/api/v1/account/vehicles/vehicle1 For editing information of name “vehicle1". DELETE vehicles/{name} https://app.elasticroute.com/api/v1/account/vehicles/vehicle1 For deleting a vehicle with name of “vehicle1". Request And Response For
GET https://app.elasticroute.com/api/v1/account/vehicles/{name}
Example: https://app.elasticroute.com/api/v1/account/vehicles/vehicle1
Request Body
Response Body
{ "data": { "depot": null, "end_depot": null, "name": "Vehicle1", "priority": 10, "service_radius": null, "weight_capacity": null, "volume_capacity": null, "seating_capacity": null, "buffer": 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, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "return_to_depot": true, "all_groups": true, "unzoned": true, "created_at": "2019-10-01 07:57:11", "updated_at": "2019-10-01 13:11:49", "zones": [], "vehicle_types": [], "groups": [], "attributes": { "organization_name": "Test" } } }
POST https://app.elasticroute.com/api/v1/account/vehicles
- Required field:
- name
Request Body
Example 1:
{ "data": { "depot": null, "end_depot": null, "name": "vehicle1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ] } }
Example 2:
{ "data": { "name": "vehicle1" } }
Response Body
{ "data": { "depot": null, "end_depot": null, "name": "vehicle1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-01 01:28:15", "updated_at": "2019-06-01 01:28:15" }, "attributes": { "organization_name": "Test" } }
PUT https://app.elasticroute.com/api/v1/account/vehicles/{name}
Example: https://app.elasticroute.com/api/v1/account/vehicles/vehicle1
Request Body
{ "data": { "depot": null, "end_depot": null, "name": "vehicle2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ] } }
Response Body
{ "data": { "depot": null, "end_depot": null, "name": "vehicle2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-01 01:28:15", "updated_at": "2019-06-01 01:28:15" }, "attributes": { "organization_name": "Test" } }
DELETE https://app.elasticroute.com/api/v1/account/vehicles/{name}
Example: https://app.elasticroute.com/api/v1/account/vehicles/vehicle1
Request Body
{ "data": [ { "name": "Vehicle1" }, { "name": "Vehicle2" } ] }
Response Body
If vehicle is valid and deleted.
{ "message": "Deleted.", "attributes": { "organization_name": "Test" } }
If vehicle is invalid and not deleted.
{ "message": "Model Not Found." }
-
Bulk Vehicles
Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
List Of Endpoints Method {endpoint} Example Description GET vehicles https://app.elasticroute.com/api/v1/account/vehicles
https://app.elasticroute.com/api/v1/account/vehicles?limit=100&page=1For retrieving information of all vehicles in your account.
Max. number of limit: 100 per page.POST vehicles/bulk https://app.elasticroute.com/api/v1/account/vehicles/bulk For mass creating vehicles.
You may specify a ?delete=true to clear all existing vehicle data, prior to creating the new vehicles.PUT vehicles/bulk https://app.elasticroute.com/api/v1/account/vehicles/bulk For mass editing information of vehicles. DELETE vehicles https://app.elasticroute.com/api/v1/account/vehicles For deleting all vehicles in your account. Request And Response For
GET https://app.elasticroute.com/api/v1/account/vehicles
Example: https://app.elasticroute.com/api/v1/account/vehicles?limit=100&page=1
Request Body
Response Body
{ "data": [ { "depot": null, "end_depot": null, "name": "Vehicle1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-01 01:28:15", "updated_at": "2019-06-02 06:57:02", "zones": [], "vehicle_types": [], "groups": [], "all_groups": true }, { "depot": null, "name": "Vehicle2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "service_radius": null, "return_to_depot": true, "created_at": "2019-06-01 06:56:50", "updated_at": "2019-06-02 06:56:50", "zones": [], "vehicle_types": [], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "all_groups": false } ], "links": { "first": "http://app.elasticroute.com/api/v1/account/vehicles?page=1", "last": "http://app.elasticroute.com/api/v1/account/vehicles?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "http://app.elasticroute.com/api/v1/account/vehicles", "per_page": 15, "to": 2, "total": 2 }, "attributes": { "organization_name": "Test" } }
POST https://app.elasticroute.com/api/v1/account/vehicles/bulk
- Required field:
- name
Request Body
{ "data": [ { "depot": null, "end_depot": null, "name": "Vehicle1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ] }, { "depot": null, "name": "Vehicle2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ] } ] }
Response Body
{ "data": [ { "depot": null, "end_depot": null, "name": "Vehicle1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-19 01:28:15", "updated_at": "2019-06-20 06:57:02" }, { "depot": null, "name": "Vehicle2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-20 06:56:50", "updated_at": "2019-06-20 06:56:50" } ], "links": { "first": "http://app.elasticroute.com/api/v1/account/vehicles?page=1", "last": "http://app.elasticroute.com/api/v1/account/vehicles?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "http://app.elasticroute.com/api/v1/account/vehicles", "per_page": 15, "to": 2, "total": 2 }, "attributes": { "organization_name": "Test" } }
PUT https://app.elasticroute.com/api/v1/account/vehicles/bulk
Request Body
{ "data": [ { "name": "Vehicle1", "data": { "depot": null, "end_depot": null, "name": "V1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ] } }, { "name": "Vehicle2", "data": { "depot": null, "end_depot": null, "name": "V2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ] } } ] }
Response Body
{ "data": [ { "depot": null, "end_depot": null, "name": "V1", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-01 01:28:15", "updated_at": "2019-06-03 06:56:50" }, { "depot": null, "end_depot": null, "name": "V2", "priority": 10, "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, "buffer": null, "avail": true, "avail_from": 900, "avail_till": 1700, "avail_mon": true, "avail_tue": true, "avail_wed": true, "avail_thu": true, "avail_fri": true, "avail_sat": true, "avail_sun": true, "service_radius": null, "return_to_depot": true, "break_time_window": null, "service_radius": null, "return_to_depot": true, "all_groups": false, "unzoned": true, "zones": [ "Zone1", "Zone2", "Zone3" ], "vehicle_types": [ "Vehicle Type1", "Vehicle Type2", "Vehicle Type3" ], "groups": [ "Gp 1", "Gp 2", "Gp 3" ], "created_at": "2019-06-01 06:56:50", "updated_at": "2019-06-03 06:56:50" } ], "links": { "first": "http://app.elasticroute.com/api/v1/account/vehicles?page=1", "last": "http://app.elasticroute.com/api/v1/account/vehicles?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "http://app.elasticroute.com/api/v1/account/vehicles", "per_page": 15, "to": 2, "total": 2 }, "attributes": { "organization_name": "Test" } }
DELETE https://app.elasticroute.com/api/v1/account/vehicles
Example: https://app.elasticroute.com/api/v1/account/vehicles
Request Body
Response Body
If vehicle is valid and deleted.
{ "message": "Deleted.", "attributes": { "organization_name": "Test" } }
-
Field Headers And Description
API Field Dashboard Field Description Type name Name Name of the Vehicle. Required. Unique. String depot 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.
Refer to How To Add Depots.String end_depot End Depot The name of the depot which is specified in the depots. Typically, it is the ending location where the driver ends the run. Optional.
Refer to How To Select The Start And End Depots For Your Vehicle.String priority Priority The priority of the vehicle. Higher the priority, the higher the order of the vehicle to get assigned the stop first during planning. Optional.
Refer to How To Set Priority For Your VehiclesInteger max_time Max Time / Run The maximum time the vehicle can travel per run. Optional.
Refer to How To Customize Your Runs.Integer max_distance Max Distance / Run The maximum distance that the vehicle can travel per run. Optional.
Refer to How To Customize Your Runs.Integer max_stops Max Stops / Run The maximum number of stops that the vehicle can take per run. Optional.
Refer to How To Customize Your Runs.Integer max_time_per_day Max Time / Day The maximum time constraint that the vehicle can travel per day. Optional.
Refer to How To Set Time, Distance And Stops Limits For Your Vehicles.Integer max_distance_per_day Max Distance / Day The maximum distance constraint that the vehicle can travel per day. Optional.
Refer to How To Set Time, Distance And Stops Limits For Your Vehicles.Integer max_stops_per_day Max Stops / Day The maximum stops constraint that the vehicle can perform per day. Optional.
Refer to How To Set Time, Distance And Stops Limits For Your Vehicles.Integer max_runs Max Runs The maximum runs constraint that the vehicle can perform per day. Optional.
Refer to How To Set Buffer For Your Deliveries.Integer buffer Buffer A modifier to affect the traveling speed of the vehicle. The higher the number the longer the time taken for the journey between the stops. Optional.
Refer to How To Set Buffer For Your Deliveries.Integer avail Available for route planning Availability of the vehicle to be included for planning. Optional. Boolean avail_mon Mon Availability of the vehicle to be included for planning on Mondays. Optional. Boolean avail_tue Tue Availability of the vehicle to be included for planning on Tuesdays. Optional. Boolean avail_wed Wed Availability of the vehicle to be included for planning on Wednesdays. Optional. Boolean avail_thu Thu Availability of the vehicle to be included for planning on Thursdays. Optional. Boolean avail_fri Fri Availability of the vehicle to be included for planning on Fridays. Optional. Boolean avail_sat Sat Availability of the vehicle to be included for planning on Saturdays. Optional. Boolean avail_sun Sun Availability of the vehicle to be included for planning on Sundays. Optional. Boolean break_time_window Break Time Window Vehicle break time (e.g. lunch or dinner break). Optional.
Refer to How To Set Break Time For Your Vehicles.String weight_capacity Weight The weight capacity of the vehicle. If specified, the weight_load
field of the stops will be considered for route optimization. Optional.
Refer to How To Set Vehicle CapacityFloat volume_capacity Volume The volume capacity of the vehicle. If specified, the volume_load
field of the stops will be considered for route optimization. Optional.
Refer to How To Set Vehicle CapacityFloat seating_capacity Seating The seating capacity of the vehicle. If specified, the seating_load
field of the stops will be considered for route optimization. Optional.
Refer to How To Set Vehicle CapacityFloat avail_from Available From The starting time where the vehicle is available. Default: 900. Optional.
Refer to How To Set Driver Working Hours.
e.g. 0900Time Format: Gi avail_till Available Till The ending time where the vehicle is available. Default: 1700. Optional.
Refer to How To Set Driver Working Hours.
e.g. 1700Time Format: Gi service_radius Service Radius Vehicle will only serve stops within the radius (meters) of the selected depot. Default: null. Optional.
Refer to How To Use Vehicle Service Radius To Control The Assigning Of Stops To Vehicle.Integer vehicle_types Vehicle Types Only stops with the same vehicle_type
as the vehicle can be assigned to the driver. Optional.
Refer to How To Assign Stops With Special Requirements To Specific Vehicle Type.Array of Strings groups Groups Only stops with the same group
as the vehicle can be assigned to the driver. Optional.
Refer to How To Use Group For Separating Your Runs.Array of Strings all_groups All Groups Allows the stops of various groups to be assigned to the vehicles. Will override the groups
array if set to true. Optional.
Refer to How To Use Group For Separating Your Runs.Boolean unzoned Unzoned For allowing vehicle to serve stops that are not within a zone
. Optional.
Refer to How To Set Up Zone For Geofencing Of Stops.Boolean zones Zones The Vehicle can only be assigned stops with the same zone
. Optional.
Refer to How To Set Up Zone For Geofencing Of Stops.Array of Strings return_to_depot Return to depot at the end of the runs? Specify whether the vehicle is required to return to the depot. The time taken to return to depot will be considered if this field is set to true.
If set to true, the algorithm will be set to closed-path routing, else the algorithm will be set to open-path routing. Optional.
Refer to How To Select Between Open Or Closed Path Routing For Your Vehicle.Boolean created_at Not Shown UTC time of when the vehicle is created. Result. Date/ Time update_at Not Shown UTC time of when the vehicle is updated. Result. Date/ Time
Stops
This section is for performing the Create, Read, Update and Delete (CRUD) of stops.
-
Single Stop
Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
Format of {date}: “YYYY-MM-DD" e.g. 2019-06-01List Of Endpoints Method {endpoint} Example Description GET stops/{date}/{name} https://app.elasticroute.com/api/v1/account/stops/2019-06-01/stop1 For retrieving information of “stop1". POST stops/{date} https://app.elasticroute.com/api/v1/account/stops/2019-06-01 For creating a stop on a particular “date". PUT stops/{date}/{name} https://app.elasticroute.com/api/v1/account/stops/2019-06-01/stop1 For editing information of a stop with “date" and “name". DELETE stops/{date}/{name} https://app.elasticroute.com/api/v1/account/stops/2019-06-01/stop1 For deleting a stop with “date" and “name". Request And Response For
GET https://app.elasticroute.com/api/v1/account/stops/{date}/{name}
Example: https://app.elasticroute.com/api/v1/account/stops/2019-10-01/stop1
Sample Request Body
Sample Response Body
{ "data": { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Changi Airport", "time_window": null, "blackout_window": null, "address": "80 Airport Boulevard Singapore 819642", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": "vehicle1", "run": 1, "sequence": 3, "eta": 1001, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.3644202, "lng": 103.9893421, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": "Default", "plan_depot": "Depot 1", "plan_time_window": "Default", "plan_service_time": 5, "plan_break_time": null, "mapped_at": "2019-10-01 05:32:41", "planned_at": "2019-10-01 05:33:18", "created_at": "2019-10-01 05:32:41", "updated_at": "2019-10-01 05:33:18" }, "attributes": { "organization_name": "Test" } }
POST https://app.elasticroute.com/api/v1/account/stops/{date}
Example: https://app.elasticroute.com/api/v1/account/stops/2019-10-01
- Required fields:
- name
- address
Sample Request Body
Example 1:
{ "data": { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642", "lat": "1.3644202", "lng": "103.9893421", "preassign_to": null, "weight_load": null, "volume_load": null, "seating_load": null, "time_window": null, "service_time": null, "vehicle_type": null, "depot": null, "detrack_id": null, "group": null } }
Example 2:
{ "data": { "name": "Changi Airport", "address": "80 Airport Boulevard (S)819642" } }
Sample Response Body
{ "data": { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Changi Airport", "time_window": null, "blackout_window": null, "address": "80 Airport Boulevard (S)819642", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.3644202, "lng": 103.9893421, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:31:03", "planned_at": null, "created_at": "2019-10-01 06:31:03", "updated_at": "2019-10-01 06:31:03" }, "attributes": { "organization_name": "Test" } }
PUT https://app.elasticroute.com/api/v1/account/stops/{date}/{name}
Example: https://app.elasticroute.com/api/v1/account/stops/2019-10-01/stop1
Sample Request Body
{ "data": { "name": "Stop123", "address": "80 Airport Boulevard (S)819642", "lat": "1.3644202", "lng": "103.9893421", "preassign_to": null, "weight_load": null, "volume_load": null, "seating_load": null, "time_window": null, "service_time": null, "vehicle_type": null, "depot": null, "detrack_id": null, "group": null } }
Sample Response Body
{ "data": { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Stop123", "time_window": null, "blackout_window": null, "address": "80 Airport Boulevard (S)819642", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.3644202, "lng": 103.9893421, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:31:03", "planned_at": null, "created_at": "2019-10-01 06:31:03", "updated_at": "2019-10-01 06:31:03" }, "attributes": { "organization_name": "Test" } }
DELETE https://app.elasticroute.com/api/v1/account/stops/{date}/{name}
Example: https://app.elasticroute.com/api/v1/account/stops/2019-06-01/stop1
Sample Request Body
Sample Response Body
If stop is valid and deleted.
{ "message": "Deleted." "attributes": { "organization_name": "Test" } }
If stop is invalid or not found.
{ "message": "Stop Not Found." }
-
Bulk Stops
Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
Format of {date}: “YYYY-MM-DD" e.g. 2019-06-01List Of Endpoints Method {endpoint} Example Description GET stops/{date} https://app.elasticroute.com/api/v1/account/stops/2019-06-01
https://app.elasticroute.com/api/v1/account/stops/2019-06-01?limit=100&page=1For retrieving information of stops on a certain “date".
Max. number of limit: 100 per page.POST stops/{date}/bulk https://app.elasticroute.com/api/v1/account/stops/2019-06-01/bulk For creating stops on a certain “date" .
You may specify a ?delete=true to delete existing data on that “date", prior to creating the new stops.DELETE stops/{date} https://app.elasticroute.com/api/v1/account/stops/2019-06-01 For deleting all stops on a certain “date". Request And Response For
GET https://app.elasticroute.com/api/v1/account/stops/{date}?limit={number}&page={number}
- Example:
- https://app.elasticroute.com/api/v1/account/stops/2019-10-01
- https://app.elasticroute.com/api/v1/account/stops/2019-10-01?limit=100&page=1
Sample Request Body
Sample Response Body
{ "data": [ { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Singapore Zoo", "time_window": null, "blackout_window": null, "address": "80 Mandai Lake Road Singapore 729826", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.4044825, "lng": 103.7898931, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:49:17", "planned_at": null, "created_at": "2019-10-01 06:49:17", "updated_at": "2019-10-01 06:49:17" }, { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Gardens By the Bay", "time_window": null, "blackout_window": null, "address": "18 Marina Gardens Drive Singapore 018953", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.2815683, "lng": 103.8614245, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:49:17", "planned_at": null, "created_at": "2019-10-01 06:49:17", "updated_at": "2019-10-01 06:49:17" }, { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Changi Airport", "time_window": null, "blackout_window": null, "address": "80 Airport Boulevard Singapore 819642", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.3644202, "lng": 103.9893421, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:49:17", "planned_at": null, "created_at": "2019-10-01 06:49:17", "updated_at": "2019-10-01 06:49:17" } ], "links": { "first": "https://app.elasticroute.com/api/v1/account/stops/2019-10-02/bulk?page=1", "last": "https://app.elasticroute.com/api/v1/account/stops/2019-10-02/bulk?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https://app.elasticroute.com/api/v1/account/stops/2019-10-02/bulk", "per_page": 15, "to": 3, "total": 3 }, "attributes": { "organization_name": "Test" } }
POST https://app.elasticroute.com/api/v1/account/stops/{date}/bulk
Example: https://app.elasticroute.com/api/v1/account/stops/2019-06-01/bulk
- Required fields for Full Address:
- name
- address
- Required fields for Line Address:
- name
- address_1
- address_2
- address_3
Sample Request Body
{ "data": [ { "name": "Changi Airport", "address": "80 Airport Boulevard Singapore 819642", "lat": "1.3644202", "lng": "103.9893421" }, { "name": "Singapore Zoo", "address": "80 Mandai Lake Road Singapore 729826", "lat": "1.4044825", "lng": "103.7898931" }, { "name": "Gardens By the Bay", "address": "18 Marina Gardens Drive Singapore 018953", "lat": "1.2815683", "lng": "103.8614245" } ] }
Sample Response Body
{ "data": [ { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Singapore Zoo", "time_window": null, "blackout_window": null, "address": "80 Mandai Lake Road Singapore 729826", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.4044825, "lng": 103.7898931, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:49:17", "planned_at": null, "created_at": "2019-10-01 06:49:17", "updated_at": "2019-10-01 06:49:17" }, { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-02", "name": "Gardens By the Bay", "time_window": null, "blackout_window": null, "address": "18 Marina Gardens Drive Singapore 018953", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.2815683, "lng": 103.8614245, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:49:17", "planned_at": null, "created_at": "2019-10-01 06:49:17", "updated_at": "2019-10-01 06:49:17" }, { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-02", "name": "Changi Airport", "time_window": null, "blackout_window": null, "address": "80 Airport Boulevard Singapore 819642", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "plan_zones": [], "city": null, "state": null, "country": null, "weight_load": null, "volume_load": null, "seating_load": null, "service_time": null, "priority": 10, "preassign_to": null, "assign_to": null, "run": null, "sequence": null, "eta": null, "time_from_previous_stop": null, "distance_from_previous_stop": null, "lat": 1.3644202, "lng": 103.9893421, "exception": null, "exception_reason": "", "violations": [], "sorted": false, "transferred": false, "plan_vehicle_type": null, "plan_depot": null, "plan_time_window": null, "plan_service_time": null, "plan_break_time": null, "mapped_at": "2019-10-01 06:49:17", "planned_at": null, "created_at": "2019-10-01 06:49:17", "updated_at": "2019-10-01 06:49:17" } ], "attributes": { "organization_name": "Test" } }
DELETE https://app.elasticroute.com/api/v1/account/stops/{date}
Example: https://app.elasticroute.com/api/v1/account/stops/2019-06-01
Sample Request Body
Sample Response Body
If stops are valid and deleted.
{ "message": "Deleted.", "attributes": { "organization_name": "Test" } }
-
Field Headers And Description
API Field Dashboard Field Description Type name Name Unique identifier of the stop. Required. Unique. String address Address Full address of the stop. Required if Line Address; or lat
andlng
is not provided.String address_1 Not Shown Part 1 of Line Address. Required if Full Address; or lat
andlng
is not provided.String address_2 Not Shown Part 2 of Line Address. Required if Full Address; or lat
andlng
is not provided.String address_3 Not Shown Part 3 of Line Address. Required if Full Address; or lat
andlng
is not provided.String country Not Shown Country of Line address. Optional. String city Not Shown City of Line address. Optional. String state Not Shown State of Line address. Optional. String postal_code Not Shown Postal code/ Zipcode of Line address. Optional. String lat Lat Latitude of the stop. Optional. Will take this latitude value for stop if provided. Float lng Lng Longitude of the stop. Optional. Will take this longitude value for stop if provided. Float weight_load Weight Load Weight load of the stop. To be used with weight_capacity
of the vehicle. Optional.
Refer to How To Set Vehicle Capacity.Float volume_load Volume Load Volume load of the stop. To be used with volume_capacity
of the vehicle. Optional.
Refer to How To Set Vehicle Capacity.Float seating_load Seating Load Seating load of the stop. To be used with seating_capacity
of the vehicle. Optional.
Refer to How To Set Vehicle Capacity.Float service_time Service Time Additional service time (minutes) to be added to the stop. Optional.
Refer to How To Set Service Time For Your Stops.Integer priority Priority Priority for serving the stop. Stops with a higher priority will be planned first. Optional.
Refer to How To Set Priority For Your Stops.Integer time_window Time Window Time window of your stop for performing the stop. Optional.
Refer to How To Set Time Windows.String blackout_window Blackout Window Blackout time window constraint of your stop. Systems will not assign vehicle to the stop during this time range; the eta
will be out of this time range.
Optional.
Refer to How To Set Blackout (Do-Not-Deliver) Time Window For Your Stops.String vehicle_type Vehicle Type The stop is matched with the vehicle that holds the same name in the vehicle_types
field of the vehicles. Optional.
Refer to How To Assign Stops With Special Requirements To Specific Vehicle Type.String depot Depot The name of one of the depot specified in the depots. The starting location where the driver would pickup the goods/ products to be delivered to the stops. Optional.
Refer to How To Add Depots.String group Group Group of the stop to include/exclude the stop for planning. Optional.
Refer to How To Use Group For Separating Your Runs.String load_id Load ID For use with Split Load under General > Settings. If enabled, the systems will only assign the stop to the vehicle once per unique load_id. Can be used for Split Delivery Vehicle Routing Problem (SVRP) for systems to assign multiple vehicles to the same location. Optional.
Refer to How To Use The Load ID To Split The Stops Amongst Your Vehicles.String detrack_id Not Shown Only valid for stops that were pulled from corresponding Detrack account. String preassign_to Pre-assign To For use to assign the job to the vehicle
prior to planning. Optional.
Refer to How To Pre-Assign The Stop To The Vehicle.String plan_zones Not Shown The zone
being assigned to the stop during planning.
Result.Array of Strings assign_to Assign To The assigned driver to the stop after the planning. Result. String run Run The run number for the stop after planning. Result. Integer sequence Seq The sequence where the stops should be visited in a given run. Result. Integer eta ETA The estimated time of arrival of the driver to reach the stop. Result. Date/ Time time_from_previous_stop Time Traveling time (mins) to reach the current stop from previous stop. Result. Integer distance_from_previous_stop Distance Traveling distance to reach the stop.
Distance between current and previous stop. Result.Float exception Exception Errors in planning.
Unserved: The stop cannot be served due to the time/ capacity limit of the drivers.
Unmapped: The stop cannot be geocoded.
Result.
Refer to How To Resolve The Various Exceptions And Violations.String exception_reason Exception Reason Reason for Unserved stop. Result.
Refer to How To Resolve The Various Exceptions And Violations.String plan_vehicle_type Not Shown The vehicle being assigned to the stop. Result. String plan_depot Not Shown The depot
being assigned to the stop after planning. Result.String plan_service_time Not Shown Value of service_time
used when planning the stop. Result.String plan_break_time Not Shown Value of break_time
used when planning the stop. Result.
Refer to How To Set Up Break Time Windows For Your Drivers.String mapped_at Not Shown UTC time when the address is geocoded into its corresponding latitude and longitude. Result. Date/ Time planned_at Not Shown UTC time when the stop is planned. Result. Date/ Time created_at Not Shown UTC time when the stop is created. Result. Date/ Time updated_at Not Shown UTC time when the stop is updated. Result. Date/ Time sorted Sorted Indicates whether is the stop being manually resorted. Result.
Refer to How To Sort The Stops Of Your Run Manually.Boolean transferred Transferred Indicates whether is the stop being manually transferred from another run. Result.
Refer to How To Sort The Stops Of Your Run Manually.Boolean violations Violations Violations after the run is being manually resorted, for example if the sorted run exceeds the time_window
of the stop, or the Vehicle Working Hours etc. Result.
Refer to How To Resolve The Various Exceptions And Violations.Array of Strings
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-10-01
Method | {endpoint} | Example | Description |
---|---|---|---|
POST | stops/{date}/plan | https://app.elasticroute.com/api/v1/account/stops/2019-10-01/plan | To start the planning process. |
POST | stops/{date}/plan/stop | https://app.elasticroute.com/api/v1/account/stops/2019-10-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-10-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
Sample Response Body
{ "data": { "date": "2019-10-01", "organization_name": "Test", "details": { "stops": [ { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Singapore Zoo", "time_window": null, "blackout_window": null, "address": "80 Mandai Lake Road Singapore 729826", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "city": null, "state": null, "country": 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": 915, "time_from_previous_stop": 15, "distance_from_previous_stop": 16.23, "lat": 1.4044825, "lng": 103.7898931, "exception": null, "exception_reason": "", "violations": null, "sorted": false, "transferred": false, "plan_vehicle_type": "Default", "plan_depot": "Depot 1", "plan_time_window": "Default", "plan_service_time": 5, "plan_break_time": null, "mapped_at": "2019-11-07 05:32:41", "planned_at": "2019-11-07 05:33:18", "created_at": "2019-11-07 05:32:41", "updated_at": "2019-11-07 05:33:18" }, { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Gardens By the Bay", "time_window": null, "blackout_window": null, "address": "18 Marina Gardens Drive Singapore 018953", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "city": null, "state": null, "country": 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": 941, "time_from_previous_stop": 21, "distance_from_previous_stop": 22.04, "lat": 1.2815683, "lng": 103.8614245, "exception": null, "exception_reason": "", "violations": null, "sorted": false, "transferred": false, "plan_vehicle_type": "Default", "plan_depot": "Depot 1", "plan_time_window": "Default", "plan_service_time": 5, "plan_break_time": null, "mapped_at": "2019-11-07 05:32:41", "planned_at": "2019-11-07 05:33:18", "created_at": "2019-11-07 05:32:41", "updated_at": "2019-11-07 05:33:18" }, { "detrack_id": null, "load_id": null, "vehicle_type": null, "depot": null, "group": null, "date": "2019-10-01", "name": "Changi Airport", "time_window": null, "blackout_window": null, "address": "80 Airport Boulevard Singapore 819642", "address_1": null, "address_2": null, "address_3": null, "postal_code": null, "city": null, "state": null, "country": 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": 3, "eta": 1001, "time_from_previous_stop": 16, "distance_from_previous_stop": 19.02, "lat": 1.3644202, "lng": 103.9893421, "exception": null, "exception_reason": "", "violations": null, "sorted": false, "transferred": false, "plan_vehicle_type": "Default", "plan_depot": "Depot 1", "plan_time_window": "Default", "plan_service_time": 5, "plan_break_time": null, "mapped_at": "2019-11-07 05:32:41", "planned_at": "2019-11-07 05:33:18", "created_at": "2019-11-07 05:32:41", "updated_at": "2019-11-07 05:33:18" } ], "zones": [ { "name": "zone1", "details": { "points": [ { "lat": 1.3848023235902782, "lng": 103.69531363248826 }, { "lat": 1.3141457228266713, "lng": 103.72528195381166 }, { "lat": 1.3609160643530667, "lng": 103.76756966114046 }, { "lat": 1.3894760438607823, "lng": 103.75865936279298 } ] } } ], "depots": [ { "name": "Depot 1", "address": "Jurong Depot", "lat": null, "lng": null, "loading_time": null, "unloading_time": null, "auto_select": true } ], "vehicles": [ { "depot": "Depot 1", "name": "Vehicle1", "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, "buffer": null, "avail_from": 900, "avail_till": 1700, "return_to_depot": true, "break_from": null, "break_till": null, "vehicle_types": [ "Default" ] } ], "rushHours": [ { "name": "rushHour1", "from": 600, "till": 1000, "buffer": 20 } ], "generalSettings": { "country": "SG", "timezone": "Asia/Singapore", "distribute_workload": false, "distribute_workload_type": null, "loading_time": null, "unloading_time": null, "reverse_direction": false, "buffer": null, "service_time": 5, "depot_selection": "Default", "depot_selection_restrict_zone": 0, "depot_selection_radius": 20000, "distance_unit": "km", "priority_value": "lower_lower", "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, "split_load": false } }, "stage": "planned", "stats": { "total_plan_stops": 3, "total_plan_depots": 1, "total_plan_vehicles": 1, "total_plan_distance": 96.23, "total_stops_served": 3, "total_exceptions": 0, "total_runs": 1, "total_plan_time": 11 }, "progress": 100, "submitted": "2019-10-01 13:33:07", "planning": "2019-10-01 13:33:07", "planned": "2019-10-01 13:33:18" }, "attributes": { "organization_name": "Test" } }
-
Stops
Array of
stop
objects.Zones
Array of
zone
objects under Settings > Zones.
Refer to How To Set Up Zone For Geofencing Of Stops.Depots
Array of
depot
objects under Settings > Depots.
Refer to How To Add Depots.Vehicles
Array of
vehicle
objects under Settings > Vehicles.
Refer to How To Add Vehicles.Rush Hours
Array of
rushHour
objects under Settings > Rush Hours.
Refer to How To Set Rush Hours Timing.General Settings
Array of
generalSettings
object under Settings > General.Stats
Statistics in the planning of the stops. Corresponds to the information displayed in the Reports tab.
Miscellaneous
Time Windows
This section is for performing the Create, Read, Update and Delete (CRUD) of Time Windows.
-
Single Time WIndow
Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
List Of Endpoints Method {endpoint} Example Description GET time-windows/{name} https://app.elasticroute.com/api/v1/account/time-windows/timewindow1 For retrieving information of time window with name of “timewindow1". POST time-windows https://app.elasticroute.com/api/v1/account/time-windows For creating a time window. PUT time-windows/{name} https://app.elasticroute.com/api/v1/account/time-windows/timewindow1 For editing information of a time window with name of “timewindow1" . DELETE time-windows/{name} https://app.elasticroute.com/api/v1/account/time-windows/timewindow1 For deleting a time window with name of “timewindow1". Request And Response For
GET https://app.elasticroute.com/api/v1/account/time-windows/{name}
Example: https://app.elasticroute.com/api/v1/account/time-windows/timewindow2
Sample Request Body
Sample Response Body
{ "data": { "name": "timewindow2", "from": 800, "till": 900, "default": false }, "attributes": { "organization_name": "Test" } }
POST https://app.elasticroute.com/api/v1/account/time-windows
Example: https://app.elasticroute.com/api/v1/account/time-windows
- Required fields:
- name
- from
- till
Sample Request Body
{ "name": "timewindow1", "from": "0900", "till": "1000" }
Sample Response Body
{ "data": { "name": "timewindow1", "from": "0900", "till": "1000" }, "attributes": { "organization_name": "Test" } }
PUT https://app.elasticroute.com/api/v1/account/time-windows/{name}
Example: https://app.elasticroute.com/api/v1/account/time-windows/timewindow1
Sample Request Body
{ "name": "newName", "from": "0900", "till": "1200" }
Sample Response Body
{ "data": { "name": "newName", "from": "0900", "till": "1100", "default": false }, "attributes": { "organization_name": "Test" } }
DELETE https://app.elasticroute.com/api/v1/account/time-windows/{name}
Example: https://app.elasticroute.com/api/v1/account/time-windows/timewindow1
Sample Request Body
Sample Response Body
If the time window is valid and deleted.
{ "message": "Deleted.", "attributes": { "organization_name": "Test" } }
If the time window is invalid or not found.
{ "message": "Model Not Found." }
-
Bulk Time Window
Base URL: https://app.elasticroute.com/api/v1/account/{endpoint}
Format of {date}: “YYYY-MM-DD" e.g. 2019-06-01List Of Endpoints Method {endpoint} Example Description GET time-windows https://app.elasticroute.com/api/v1/account/time-windows
https://app.elasticroute.com/api/v1/account/time-windows?limit=100&page=1For retrieving information of time windowsMax. number of limit: 100 per page. POST time-windows/bulk https://app.elasticroute.com/api/v1/account/time-windows/bulk For creating multiple time windows. PUT time-windows https://app.elasticroute.com/api/v1/account/time-windows For bulk editing of multiple time windows. DELETE time-windows/bulk https://app.elasticroute.com/api/v1/account/time-window/ For deleting all time windows. Request And Response For
GET https://app.elasticroute.com/api/v1/account/time-windows
- Example:
- https://app.elasticroute.com/api/v1/account/time-windows
- https://app.elasticroute.com/api/v1/account/time-windows?limit=100&page=1
Sample Request Body
Sample Response Body
{ "data": [ { "name": "Default", "from": 900, "till": 1700, "default": true }, { "name": "timewindow1", "from": 800, "till": 900, "default": false }, { "name": "timewindow2", "from": 900, "till": 1000, "default": false } ], "links": { "first": "https://app.elasticroute.com/api/v1/account/time-windows?page=1", "last": "https://app.elasticroute.com/api/v1/account/time-windows?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https://app.elasticroute.com/api/v1/account/time-windows", "per_page": 15, "to": 3, "total": 3 }, "attributes": { "organization_name": "Test" } }
POST https://app.elasticroute.com/api/v1/account/time-windows/bulk
Sample Request Body
{ "data": [ { "name": "time1", "from": "0900", "till": "1000" }, { "name": "time2", "from": "1000", "till": "1100" }, { "name": "time3", "from": "1000", "till": "1100" } ] }
Sample Response Body
{ "data": [ { "name": "time1", "from": 900, "till": 1000, "default": false }, { "name": "time2", "from": 1000, "till": 1100, "default": false }, { "name": "time3", "from": 1000, "till": 1100, "default": false } ], "attributes": { "organization_name": "Test" } }
PUT https://app.elasticroute.com/api/v1/account/time-windows
Sample Request Body
{ "data": [ { "name": "time1", "data": { "name": "newtime1", "from": "0930", "till": "1030" } }, { "name": "time2", "data": { "name": "newtime2", "from": "1030", "till": "1130" } }, { "name": "time3", "data": { "name": "newtime3", "from": "1200", "till": "1230" } } ] }
Sample Response Body
{ "data": [ { "name": "newtime1", "from": "0930", "till": "1030", "default": false }, { "name": "newtime2", "from": "1030", "till": "1130", "default": false }, { "name": "newtime3", "from": "1200", "till": "1230", "default": false } ], "attributes": { "organization_name": "Test" } }
DELETE https://app.elasticroute.com/api/v1/account/time-windows
All of the time windows, except the one tagged with Default will be deleted.
Sample Request Body
Sample Response Body
Deletion response.
{ "message": "Deleted. Default time window will not be deleted.", "attributes": { "organization_name": "Test" } }
-
Setting the Default Time Window
The Time Window tagged with the “Default" will be used for planning in the event that a stop does not have an assigned Time Window, or absence of match.
List Of Endpoints Method {endpoint} Example Description POST time-windows https://app.elasticroute.com/api/v1/account/time-windows/timewindow1/default For tagging “timewindow1" as the Default time window for planning. Request And Response For
POST https://app.elasticroute.com/api/v1/account/time-windows/{name}/default
Example: https://app.elasticroute.com/api/v1/account/time-windows/timewindow1/default
Sample Request Body
Sample Response Body
{ "data": { "name": "timewindow1", "from": "0900", "till": "1000", "default": true
-
Field Headers And Description
API Field Dashboard Field Description Type name Name Unique identifier of the time window. Required. Unique. String from From Starting time of the stop. Required. Default: 0900. Time till Till Starting time of the stop. Required. Default: 1700. Time default Default This time window will be used for planning if there is no time window being specified for the stop, or that there is no match of time window. Boolean
Logs
This section is for users to retrieve the logs in ElasticRoute for debugging purposes.
Kindly note that the logs will be cleared after 14 days.
- Click on the profile icon at the top right corner.
- A drop-down will appear.
- Click on API Request Logs.
Posting Planned Results To A Target URL
If you wish to POST the planned results to a target URL after planning, kindly perform the following steps.
- Navigate to Settings > General.
- Scroll down to the Webhook section and enter your target URL into the Webhook URL field.
- Click Save when done.
Thereafter, after performing planning your stops, click on the Export button > Post to target URL to have the planned results sent over to your URL.