JUNGLEWORKS REST API

Route Optimization V2

Route Optimization tasks for Service tasks, Pickup and Delivery Tasks and Vehicles with different start and end locations and different shift timings.

NameTypeDescription
fleetsarray of objectsArray of fleets object. See description below.
visitsarray of objects (optional)Array of pickup and delivery task objects. See description below.
single_appointmentarray of objects (optional)Array of service task object. See description below.
maxVisitsinteger (optional)Maximum tasks that can be assigned to a driver.
speedinteger (optional)Speed factor for your vehicles.

How to construct fleets object -

NameTypeDescription
id stringThe identification parameter defined for each vehicle.
capacityinteger (optional)capacity of vehicle (weight/volume etc) but load of tasks should also be in same measure
shiftStartinteger (optional)The time when the vehicle will start its shift (e.g. 1300 means vehicle will take task after 1 PM)
shiftEndinteger (optional)The time after which the vehicle won't perform any more task (e.g. 2200, means vehicle will not perform tasks after 10 PM)
start_locationobjectStart Location object consists of 3 keys : lat (latitude), lng (longitude), name (address of location). All keys are in string form and 'name' is optional.
end_locationobjectEnd Location object consists of 3 keys : lat (latitude), lng (longitude), name (address of location). All keys are in string form and 'name' is optional.
returnToStartboolean (optional)true, if its mandatory to return to depot. false, if its not mandatory to return to depot. Default is false. Return to start value if true, will override end location.
skillstring (optional)It states the ability of the driver/vehicle to perform the particular type of tasks. For example : there are 2 vehicles x and y , x carries 'pizzas' and y 'burgurs'. Tasks having skill 'pizzas' will be assigned to x and not y , similarly for 'burgurs' will be assigned only to y.
cost_per_distancenumber (optional)Cost per km for the driver/vehicle.
fixed_costnumber (optional)Fixed cost per route for the driver/vehicle.

How to construct single_appointment object -

NameTypeDescription
idstringThe identification parameter defined for each task.
customer_idstring (optional)The identification parameter defined for customer.
phonestring (optional)Phone number of customer.
loadinteger (optional)Load/demand to be served(Unitless but it should be in same measure of capcity of vehicle).
datestringDate on which task in performed. All tasks shold have same date(MM-DD-YYYY).
skillstring (optional)It states the skill required by the driver/vehicle to perform this task. For example : there are 2 vehicles x and y , x carries 'pizzas' and y 'burgurs'. Tasks having skill 'pizzas' will be assigned to x and not y , similarly for 'burgurs' will be assigned only to y.
prioritynumber (optional)It sets the priority of the tasks. Value can be 1 (high), 2 (medium) and 3 (low).
appointmentobjectRead following rows to understand.
appointment.locationobjectLocation object consists of 3 keys : lat (latitude), lng (longitude), address (address of location). All keys are in string form and 'address' is optional.
appointment.durationinteger (optional)Time the task will take to complete (eg. 10 means 10 minutes of service time.)
appointment.start_timeinteger (optional)The time after which the task should be performed [0, 2400) (eg. 930 means 9:30 AM)
appointment.end_timeinteger (optional)The time before which the task is to be performed [0, 2400) (eg. 2350 means 11:50 PM)

How to construct visits object -

NameTypeDescription
idstringThe identification parameter defined for each task.
customer_idstring (optional)The identification parameter defined for customer.
phonestring (optional)Phone number of customer.
loadinteger (optional)Load/demand to be served.(Unitless but it should be in same measure of capacity of vehicle.)
datestringDate on which task in performed. All tasks shold have same date.(MM-DD-YYYY)
skillstring (optional)It states the skill required by the driver/vehicle to perform this task. For example : there are 2 vehicles x and y , x carries 'pizzas' and y 'burgurs'. Tasks having skill 'pizzas' will be assigned to x and not y , similarly for 'burgurs' will be assigned only to y.
prioritynumber (optional)It sets the priority of the tasks. Value can be 1 (high), 2 (medium) and 3 (low).
pickupobjectRead following rows to understand.
pickup.locationobjectLocation object consists of 3 keys : lat (latitude), lng (longitude), address (address of location). All keys are in string form and 'address' is optional.
pickup.durationinteger (optional)Time the task will take to complete (eg. 10 means 10 minutes of service time.)
pickup.start_timeinteger (optional)The time after which the task should be performed [0, 2400) (eg. 930 means 9:30 AM)
pickup.end_timeinteger (optional)The time before which the task is to be performed [0, 2400) (eg. 2350 means 11:50 PM)
dropoffobjectRead following rows to understand.
dropoff.locationobjectLocation object consists of 3 keys : lat (latitude), lng (longitude), address (address of location). All keys are in string form and 'address' is optional.
dropoff.durationinteger (optional)Time the task will take to complete (eg. 10 means 10 minutes of service time.)
dropoff.start_timeinteger (optional)The time after which the task should be performed [0, 2400) (eg. 930 means 9:30 AM)
dropoff.end_timeinteger (optional)The time before which the task is to be performed [0, 2400) (eg. 2350 means 11:50 PM)

Response Format

Response object contains 2 keys error and data. If there is any error it will be in error key. The following keys are part of data.

NameTypeDescription
noOfRoutesintegerThe number of routes all the fleets have to take in order to complete all the tasks
unassignedJobs listThe service ID's of all the tasks which are not completed
totalJobsintegerThe total number of services to be performed
totalTimeTaken (in seconds)doubleThe total time taken by all the fleets to complete all the tasks in seconds
maxTimeTaken (in seconds)doubleThe time by which all the tasks will be completed if all the fleets start at the same time
totalDistanceTravelled (in meters)doubleThe total distance covered be all the fleets in meters
statusstring'success' if all the tasks are served and 'failure' if any one of them remains unserved.
solutionslistThe list of all the fleets mapped to the services that they performed
RouteDistanceTime(in seconds)listThe list of all the fleets mapped to the time and distance covered by them to perform the tasks.

Note : Please add your valid access token in Header in order to get valid Response of an API.
Example : authorization : a32c4d0-1s4b-1aea-sa69-cdccg57h0ea

POST
https://live.flightmap.io/api/v2/vrp_pdp