NAV
shell

Contexts

Some EOS features, such as Job Transfer, require multiple sessions to work. For example, to configure EOS with Job transfer feature enabled, a new context is required. Then EOS would be able to allocate transferrable jobs to other sub-sessions in the same context.

Note: The number of sessions that can belong to the context is unlimited. However, it is always a good practice to keep this number as small as possible.

Create Context

Standard context parameters

{
    "TransferJobsBetweenSessions": true
}

Create a new context with Job Transfer enabled:

To create a new context:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session_context?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"TransferJobsBetweenSessions":true}'

EOS returns a new context ID:

{
    "ContextID": "b143c80f-2096-5259-a040-bd85391c4ac0"
}

Get Context Parameters

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session_context?apikey=$APIKEY_CORE03_UAT&ContextID=628f84bc-e7ac-56eb-896d-a8cadd4b400c" -H "accept: application/json"

Successful response example:

{
    "Parameters": {
        "TransferJobsBetweenSessions": true
    },
    "ID": "b143c80f-2096-5259-a040-bd85391c4ac0",
    "CreateTimestamp": "2021-03-04T12:27:06Z",
    "LastUpdateTimestamp": "2021-03-04T12:27:06Z",
    "SessionIDs": []
}

Update Context

curl -X PUT "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session_context?apikey=$APIKEY_CORE03_UAT&ContextID=b143c80f-2096-5259-a040-bd85391c4ac0" -H "Content-Type: application/json" -d '{"TransferJobsBetweenSessions":false}'

Successful response:

"OK"

Update existing context and turn off Job Transfer:

Get Open Contexts

Get a list of all your existing contexts:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session_contexts?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json"

Successful response example:

[
    {
        "Parameters": {
            "TransferJobsBetweenSessions": false
        },
        "ID": "b143c80f-2096-5259-a040-bd85391c4ac0",
        "CreateTimestamp": "2021-03-04T12:27:06Z",
        "LastUpdateTimestamp": "2021-03-05T09:20:45Z",
        "SessionIDs": [
            "09594806-30bc-5c0a-8a8e-857d547603de",
            "28ab513f-ffe4-5c63-b7b5-5c59bddffe68",
            "7f7eb2ed-972c-520a-83b8-1d91c7716bdc",
            "cb4e09d3-baab-55a9-9b6c-826e5a02d9c4"
        ]
    }
]

Close Context

Delete an existing context and all its sub-sessions:

curl -X DELETE "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session_context?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"ContextID":"628f84bc-e7ac-56eb-896d-a8cadd4b400c"}'

Successful response:

"OK"

Sessions

Standard session parameters

{
  "Algorithm": "auto",
  "ContextID": "5b032554-991d-555f-9676-806e5e62dc2e",
  "ContinueWithoutImprovementTime": "3m",
  "DeleteExpiredSecond": 604800,
  "FinalOutputChoice": "BestDistance",
  "IdleTimeSecond": 604800,
  "InterimOutputChoice": "BestDistance",
  "LocationPrecisionMetre": 1,
  "MaxDailyJobsNumber": 100,
  "OutputInterval": "15s",
  "PlanAllJobs": true,
  "RoutingService": "OSRM",
  "TotalRunTime": "30m"
}

Any extra attributes are passed through as-is to the core optimisation algorithm Vortex.

EOS session holds all objects and resources required for optimisation, such as Depots, Vehicles, Drivers, and Jobs.

Open Session

To create a new stand-alone session:

You can configure a new session as stand-alone by not populating the ContextID attribute.

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"Algorithm":"auto","BreaksMode":"Segmented","ContinueWithoutImprovementTime":"5m","Decompose":false,"DeleteExpiredSecond":604800,"FinalOutputChoice":"BestDistance","IdleTimeSecond":604800,"InterimOutputChoice":"BestDistance","LocationPrecision":10,"LocationPrecisionMetre":1,"MinimumTravelTime":"3m","NumDays":1,"OutputInterval":"15s","PARAMETER_OutputSeconds":true,"PlanAllJobs":true,"RoutingService":"OSRM","StatisticsInterval":"15s","TotalRunTime":"60m","WorkingTimeIncludesBreaks":true}'

Successful response example:

{
    "SessionID": "8d6399e7-7f4e-54ac-80f5-d2377c06b707"
}

Open Session with Context

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"ContextID":"b143c80f-2096-5259-a040-bd85391c4ac0"}'

Alternatively, an EOS session can be configured optionally as part of an already created context. To achieve this, make sure to populate the attribute ContextID with the correct value.

Successful response example:

{
    "SessionID": "53b1553c-6174-5268-9def-7fbd8ba27811"
}

Get Session Parameters

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT&SessionID=53b1553c-6174-5268-9def-7fbd8ba27811" -H "accept: application/json"

Successful response example:

{
  "Parameters": {
    "Algorithm": "auto",
    "ContextID": "b143c80f-2096-5259-a040-bd85391c4ac0",
    "ContinueWithoutImprovementTime": "3m",
    "DeleteExpiredSecond": 604800,
    "FinalOutputChoice": "BestMileage",
    "IdleTimeSecond": 604800,
    "InterimOutputChoice": "BestMileage",
    "LocationPrecisionMetre": 1,
    "OutputInterval": "15s",
    "PARAMETER_OutputOnboard": "0",
    "PlanAllJobs": false,
    "RoutingService": "OSRM",
    "StatisticsInterval": "15s",
    "TotalRunTime": "1h"
  },
  "ID": "53b1553c-6174-5268-9def-7fbd8ba27811",
  "CreateTimestamp": "2021-03-05T09:42:15Z",
  "LastUpdateTimestamp": "2021-03-05T09:42:15Z"
}

Get a specific session by ID:

Update Session

curl -X PUT "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT&SessionID=53b1553c-6174-5268-9def-7fbd8ba27811" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Algorithm":"auto","ContextID":"b143c80f-2096-5259-a040-bd85391c4ac0","ContinueWithoutImprovementTime":"3m","DeleteExpiredSecond":604800,"FinalOutputChoice":"BestMileage","IdleTimeSecond":604800,"InterimOutputChoice":"BestMileage","LocationPrecisionMetre":1,"OutputInterval":"15s","PARAMETER_OutputOnboard":"0","PlanAllJobs":true,"RoutingService":"OSRM","StatisticsInterval":"15s","TotalRunTime":"1h","PARAMETER_OutputSeconds":true,"WorkingTimeIncludesBreaks":true}'

Successful response:

"OK"

Update session parameters, add some optimisation attributes:

Gets Open Sessions

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/sessions?apikey=$APIKEY_CORE03_UAT" -H "accept: application/json"

Successful response example:

[
  {
    "Parameters": {
      "Algorithm": "auto",
      "ContextID": "b143c80f-2096-5259-a040-bd85391c4ac0",
      "ContinueWithoutImprovementTime": "3m",
      "DeleteExpiredSecond": 604800,
      "FinalOutputChoice": "BestMileage",
      "IdleTimeSecond": 604800,
      "InterimOutputChoice": "BestMileage",
      "LocationPrecisionMetre": 1,
      "OutputInterval": "15s",
      "PARAMETER_OutputOnboard": "0",
      "PARAMETER_OutputSeconds": true,
      "PlanAllJobs": true,
      "RoutingService": "OSRM",
      "StatisticsInterval": "15s",
      "TotalRunTime": "1h",
      "WorkingTimeIncludesBreaks": true
    },
    "ID": "53b1553c-6174-5268-9def-7fbd8ba27811",
    "CreateTimestamp": "2021-03-05T09:42:15Z",
    "LastUpdateTimestamp": "2021-03-05T09:50:58Z"
  },
  {
    "Parameters": {
      "Algorithm": "auto",
      "ContextID": "b143c80f-2096-5259-a040-bd85391c4ac0",
      "ContinueWithoutImprovementTime": "3m",
      "DeleteExpiredSecond": 604800,
      "FinalOutputChoice": "BestMileage",
      "IdleTimeSecond": 604800,
      "InterimOutputChoice": "BestMileage",
      "LocationPrecisionMetre": 1,
      "OutputInterval": "15s",
      "PARAMETER_OutputOnboard": "0",
      "PlanAllJobs": false,
      "RoutingService": "OSRM",
      "StatisticsInterval": "15s",
      "TotalRunTime": "1h"
    },
    "ID": "7f7eb2ed-972c-520a-83b8-1d91c7716bdc",
    "CreateTimestamp": "2021-03-05T09:30:45Z",
    "LastUpdateTimestamp": "2021-03-05T09:32:09Z"
  }
]

Get your existing sessions:

Close session

curl -X DELETE "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "accept: application/json" -H "Content-Type: application/json" -d '{"SessionID":"5eabac92-abbc-5d0a-a967-048d0a50dd54"}'

Successful response:

"OK"

Delete existing session by ID:

Resources

Resources represent optimisation objects required by EOS to create a successful plan. To create a successful plan for a specific session and date, at least one vehicle and Driver should be available on the planning date.

Resources end-points allow full control over resources and provide the functionality to add, retrieve, update, and delete resources objects.

Add Resources

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"Characteristics":["0718"],"IdString":"0718","IncludeVehicleCharacteristics":[["0718"]],"LoadingTime":"32m","LocationLatLong":[52.617389,-2.687529]}],"Drivers":[{"CostPerDay":100,"CostPerHour":40,"DebriefingTime":"10m","DrivingBreakThreshold":"24h","IdString":"DRV_0718_0","MaximumWorkingTime":"12h","ShiftEarlyStartTime":"06:00:00","ShiftLateStartTime":"08:00:00","WorkQualifyingBreakDuration":"24h"}],"VehicleDepotMap":[{"DepotId":"0718","VehicleId":"VEH_0718_0"}],"VehicleDriverMap":[{"Day":1,"DriverId":"DRV_0718_0","VehicleId":"VEH_0718_0"}],"VehicleProfiles":[{"MaximumSpeedKPH":91.7326,"SpeedProfiles":[{"SpeedFactor":0.79,"TimeFrom":"0m","TimeTo":"525m"},{"SpeedFactor":0.7821,"TimeFrom":"525m","TimeTo":"540m"},{"SpeedFactor":0.7742,"TimeFrom":"540m","TimeTo":"555m"},{"SpeedFactor":0.7584,"TimeFrom":"555m","TimeTo":"570m"},{"SpeedFactor":0.7505,"TimeFrom":"570m","TimeTo":"585m"},{"SpeedFactor":0.7505,"TimeFrom":"585m","TimeTo":"600m"},{"SpeedFactor":0.7505,"TimeFrom":"600m","TimeTo":"615m"},{"SpeedFactor":0.7347,"TimeFrom":"615m","TimeTo":"630m"},{"SpeedFactor":0.711,"TimeFrom":"630m","TimeTo":"645m"},{"SpeedFactor":0.6952,"TimeFrom":"645m","TimeTo":"660m"},{"SpeedFactor":0.6715,"TimeFrom":"660m","TimeTo":"675m"},{"SpeedFactor":0.6794,"TimeFrom":"675m","TimeTo":"690m"},{"SpeedFactor":0.6952,"TimeFrom":"690m","TimeTo":"705m"},{"SpeedFactor":0.7031,"TimeFrom":"705m","TimeTo":"720m"},{"SpeedFactor":0.711,"TimeFrom":"720m","TimeTo":"735m"},{"SpeedFactor":0.7031,"TimeFrom":"735m","TimeTo":"750m"},{"SpeedFactor":0.6952,"TimeFrom":"750m","TimeTo":"765m"},{"SpeedFactor":0.6794,"TimeFrom":"765m","TimeTo":"780m"},{"SpeedFactor":0.6715,"TimeFrom":"780m","TimeTo":"795m"},{"SpeedFactor":0.7031,"TimeFrom":"795m","TimeTo":"810m"},{"SpeedFactor":0.7347,"TimeFrom":"810m","TimeTo":"825m"},{"SpeedFactor":0.7584,"TimeFrom":"825m","TimeTo":"840m"},{"SpeedFactor":0.79,"TimeFrom":"840m","TimeTo":"1425m"},{"SpeedFactor":0.8295,"TimeFrom":"1425m","TimeTo":"1440m"}],"TransportMode":"car","Type":"VEH_PF_0718_0"}],"Vehicles":[{"Capacities":[943,27],"Characteristics":["0718"],"CostPerDay":100,"CostPerDayOfNonUse":0,"CostPerKm":10,"EndLocationLatLong":[52.617389,-2.687529],"IdString":"VEH_0718_0","StartLocationLatLong":[52.617389,-2.687529],"StartTime":"0m","SuppressDepotReload":true,"Type":"VEH_PF_0718_0"}]}'

Successful response:

"OK"

Add one depot, one vehicle, one driver available for one year:

Get Resources

Get resources available on 2021-02-05:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&ResourceTypes=Depots,Drivers,Vehicles,VehicleProfiles,Jobs,VehicleDepotMap,VehicleDriverMap&StartDate=2021-02-05&EndDate=2021-02-05" -H "accept: application/json"

Successful response example:

{
  "Depots": [
    {
      "Characteristics": ["0718"],
      "IdString": "0718",
      "IncludeVehicleCharacteristics": [["0718"]],
      "LoadingTime": "32m",
      "LocationLatLong": [52.617389,-2.687529],
      "Extra": {"Id":23618493,"StartDate":"2021-01-01","EndDate":"2031-12-31"}
    }
  ],
  "Drivers": [{
      "CostPerDay": 100, 
      "CostPerHour": 40, 
      "DebriefingTime": "10m", 
      "DrivingBreakThreshold": "24h", 
      "IdString": "DRV_0718_0", 
      "MaximumWorkingTime": "12h", 
      "ShiftEarlyStartTime": "06:00:00", 
      "ShiftLateStartTime": "08:00:00", 
      "WorkQualifyingBreakDuration": "24h", 
      "Extra": {"Id":23618495,"StartDate":"2021-01-01","EndDate":"2031-12-31"}
    }],
  "Vehicles": [
    {
      "Capacities": [943, 27],
      "Characteristics": ["0718"],
      "CostPerDay": 100,
      "CostPerDayOfNonUse": 0,
      "CostPerKm": 10,
      "EndLocationLatLong": [52.617389,-2.687529],
      "IdString": "VEH_0718_0",
      "StartLocationLatLong": [52.617389,-2.687529],
      "StartTime": "0m",
      "SuppressDepotReload": true,
      "Type": "VEH_PF_0718_0",
      "Extra": {"Id":23618497,"StartDate":"2021-01-01","EndDate":"2031-12-31"}
    }
  ],
  "VehicleProfiles": [
    {
      "MaximumSpeedKPH": 91.7326,
      "SpeedProfiles": [
        {"SpeedFactor":0.79,"TimeFrom":"0m","TimeTo":"525m"},
        {"SpeedFactor":0.7821,"TimeFrom":"525m","TimeTo":"540m"},
        {"SpeedFactor":0.7742,"TimeFrom":"540m","TimeTo":"555m"},
        {"SpeedFactor":0.7584,"TimeFrom":"555m","TimeTo":"570m"},
        {"SpeedFactor":0.7505,"TimeFrom":"570m","TimeTo":"585m"},
        {"SpeedFactor":0.7505,"TimeFrom":"585m","TimeTo":"600m"},
        {"SpeedFactor":0.7505,"TimeFrom":"600m","TimeTo":"615m"},
        {"SpeedFactor":0.7347,"TimeFrom":"615m","TimeTo":"630m"},
        {"SpeedFactor":0.711,"TimeFrom":"630m","TimeTo":"645m"},
        {"SpeedFactor":0.6952,"TimeFrom":"645m","TimeTo":"660m"},
        {"SpeedFactor":0.6715,"TimeFrom":"660m","TimeTo":"675m"},
        {"SpeedFactor":0.6794,"TimeFrom":"675m","TimeTo":"690m"},
        {"SpeedFactor":0.6952,"TimeFrom":"690m","TimeTo":"705m"},
        {"SpeedFactor":0.7031,"TimeFrom":"705m","TimeTo":"720m"},
        {"SpeedFactor":0.711,"TimeFrom":"720m","TimeTo":"735m"},
        {"SpeedFactor":0.7031,"TimeFrom":"735m","TimeTo":"750m"},
        {"SpeedFactor":0.6952,"TimeFrom":"750m","TimeTo":"765m"},
        {"SpeedFactor":0.6794,"TimeFrom":"765m","TimeTo":"780m"},
        {"SpeedFactor":0.6715,"TimeFrom":"780m","TimeTo":"795m"},
        {"SpeedFactor":0.7031,"TimeFrom":"795m","TimeTo":"810m"},
        {"SpeedFactor":0.7347,"TimeFrom":"810m","TimeTo":"825m"},
        {"SpeedFactor":0.7584,"TimeFrom":"825m","TimeTo":"840m"},
        {"SpeedFactor":0.79,"TimeFrom":"840m","TimeTo":"1425m"},
        {"SpeedFactor":0.8295,"TimeFrom":"1425m","TimeTo":"1440m"}
      ],
      "TransportMode": "car",
      "Type": "VEH_PF_0718_0",
      "Extra": {"Id":23618499,"StartDate":"2021-01-01","EndDate":"2031-12-31"}
    }
  ],
  "Jobs": [],
  "VehicleDepotMap": [
    {
      "DepotId": "0718", "VehicleId": "VEH_0718_0", 
      "Extra": {"Id":4771169,"StartDate":"2021-01-01","EndDate":"2031-12-31"}
    }
  ],
  "VehicleDriverMap": [
    {
      "Day": 1, "DriverId": "DRV_0718_0", "VehicleId": "VEH_0718_0", 
      "Extra": {"Id":4771167,"StartDate":"2021-01-01","EndDate":"2031-12-31"}
    }
  ]
}

Get all resources objects available on a specific day:

Update Resources

Change depot loading time to 15m

curl -X PUT "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"Characteristics":["0718"],"IdString":"0718","IncludeVehicleCharacteristics":[["0718"]],"LoadingTime":"15m","LocationLatLong":[52.6885,-2.75213],"Extra":{"Id":23618493,"StartDate":"2021-01-01","EndDate":"2031-12-31"}}]}'

Successful response:

"OK"

Updates at least one resources object with a new payload.

Delete Resources

curl -X DELETE "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"IdString":"0718"}]}'

Successful response:

"OK"

Delete one or more resources objects from the DB. Delete end-point expects a resources object with the IdString attribute for each object populated correctly. Any other JSON attributes are ignored and not used.

Slots

A slot is a time window for servicing a job. It is defined by two times: StartTime and EndTime. It is not allowed to have two slots with the same StartTime and EndTime in the same session. However, overlapping slots are allowed.

There are two main methods to add slots to the session:

Add Slots

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartTime":"2021-03-10T06:00","EndTime":"2021-03-10T08:00","Status":"Open"},{"StartTime":"2021-03-10T08:00","EndTime":"2021-03-10T10:00","Status":"Open"},{"StartTime":"2021-03-10T10:00","EndTime":"2021-03-10T12:00","Status":"Open"},{"StartTime":"2021-03-10T12:00","EndTime":"2021-03-10T14:00","Status":"Open"},{"StartTime":"2021-03-10T14:00","EndTime":"2021-03-10T16:00","Status":"Open"},{"StartTime":"2021-03-10T16:00","EndTime":"2021-03-10T18:00","Status":"Open"}]'

Successful response:

"OK"

Add slots expects an array of slots as follows:

Add Daily Slots

Add slots for a year:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/daily?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartDate":"2021-01-01","DailyStartTime":"06:00","DailyEndTime":"18:00","EndDate":"2021-12-31","SlotDuration":"01:00","WeekDays":["Mon","Tue","Wed","Thu","Fri"]}]'

Successful response:

"OK"

Another method to add slots is by defining a pattern using the daily slots end points.

For example, add a set of slots for the whole year on weekdays only with duration of 1h each, daily start at 6am, and daily end at 6pm. This can be defined by the following pattern:

{
    "StartDate": "2021-01-01",
    "DailyStartTime": "06:00",
    "DailyEndTime": "18:00",
    "EndDate": "2021-12-31",
    "SlotDuration": "01:00",
    "WeekDays": [
      "Mon", "Tue", "Wed", "Thr", "Fri"
    ]
}

Get Slots

Get slots:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&StartTime=2021-02-05T00:00&EndTime=2021-02-05T12:00" -H "accept: application/json"

Successful Response

[
  {"StartTime":"2021-02-05T06:00:00", "EndTime":"2021-02-05T07:00:00", "Status":"Open", "Utilisation":0, "NumberOfJobs":0},
  {"StartTime":"2021-02-05T07:00:00", "EndTime":"2021-02-05T08:00:00", "Status":"Open", "Utilisation":0, "NumberOfJobs":0},
  {"StartTime":"2021-02-05T08:00:00", "EndTime":"2021-02-05T09:00:00", "Status":"Open", "Utilisation":0, "NumberOfJobs":0},
  {"StartTime":"2021-02-05T09:00:00", "EndTime":"2021-02-05T10:00:00", "Status":"Open", "Utilisation":0, "NumberOfJobs":0},
  {"StartTime":"2021-02-05T10:00:00", "EndTime":"2021-02-05T11:00:00", "Status":"Open", "Utilisation":0, "NumberOfJobs":0},
  {"StartTime":"2021-02-05T11:00:00", "EndTime":"2021-02-05T12:00:00", "Status":"Open", "Utilisation":0, "NumberOfJobs":0}
]

Get slots between two times:

Update Slots

curl -X PUT "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartTime":"2021-02-05T10:00","EndTime":"2021-02-05T11:00","Status":"Closed"}]'

Successful response:

"OK"

Get slots to confirm the change:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&StartTime=2021-02-05T10:00&EndTime=2021-02-05T12:00" -H "accept: application/json"
[
  {"StartTime":"2021-02-05T10:00:00","EndTime":"2021-02-05T11:00:00","Status":"Closed","Utilisation":0,"NumberOfJobs":0},
  {"StartTime":"2021-02-05T11:00:00","EndTime":"2021-02-05T12:00:00","Status":"Open","Utilisation":0,"NumberOfJobs":0}
]

Slots can be closed by updating status to Closed. A closed slot would never not be offered in Get free slots response.

Get Free Slots

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/available?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&StartTime=2021-03-10T00:00:00&EndTime=2021-03-10T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"FixedVisitDuration":"450s","IdString":"0718.0718_18072020_B|364031858","IncludeDepotCharacteristics":[["0718"]],"LoadTime":"0m","LocationGeohash":"gcq5bcsjbk","LocationLatLong":[52.7003,-2.77040],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m","TimeWindows":[{"Day":1,"Windows":[["780m","840m"]]}]}'

Successful response example:

[
  {
    "StartTime": "2021-03-10T06:00:00",
    "EndTime": "2021-03-10T07:00:00",
    "Status": "Open",
    "Utilisation": 0,
    "DistanceToJobMetre": 1931,
    "TimeToJobSecond": 92
  },
  {
    "StartTime": "2021-03-10T07:00:00",
    "EndTime": "2021-03-10T08:00:00",
    "Status": "Open",
    "Utilisation": 0,
    "DistanceToJobMetre": 1931,
    "TimeToJobSecond": 0
  },
  {
    "StartTime": "2021-03-10T08:00:00",
    "EndTime": "2021-03-10T09:00:00",
    "Status": "Open",
    "Utilisation": 0,
    "DistanceToJobMetre": 1931,
    "TimeToJobSecond": 0
  },
  {
    "StartTime": "2021-03-10T09:00:00",
    "EndTime": "2021-03-10T10:00:00",
    "Status": "Open",
    "Utilisation": 0,
    "DistanceToJobMetre": 1931,
    "TimeToJobSecond": 0
  }
]

Calculate slots that can service a given job. This method requires the following objects already setup in the session:

Otherwise, it returns an empty list.

Book a Slot

Book a slot example:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&StartTime=2021-03-10T08:00:00&EndTime=2021-03-10T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"FixedVisitDuration":"450s","IdString":"0718.0718_18072020_B|364031858","IncludeDepotCharacteristics":[["0718"]],"LoadTime":"0m","LocationGeohash":"gcq5bcsjbk","LocationLatLong":[52.7003,-2.77040],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m","TimeWindows":[{"Day":1,"Windows":[["780m","840m"]]}]}'

Successful response:

"OK"

Typically this is called after a Get Free Slots call to book one of the slots.

Note: This method might return a 404 NOT FOUND error if the slot doesn't exist or it is not able to service the job anymore.

Delete Slots

Delete slots example:

curl -X DELETE "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartTime":"2021-03-10T06:00:00","EndTime":"2021-03-10T07:00:00"},{"StartTime":"2021-03-10T07:00:00","EndTime":"2021-03-10T08:00:00"},{"StartTime":"2021-03-10T08:00:00","EndTime":"2021-03-10T09:00:00"},{"StartTime":"2021-03-10T09:00:00","EndTime":"2021-03-10T10:00:00"}]'

Successful response:

"OK"

Delete slots expects an array of slot objects.

Plan

The plans are the ultimate EOS outputs. These are calculated for 30 days in the future per session. This section provides schedule retrieve and finalise examples.

Get Plan

Get plan example:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&PlanDate=2021-03-10" -H "accept: application/json"

Successful response example:

{
  "Result": "SCHEDULES",
  "Data": {
    "SolutionSet": [
      {
        "Schedule": [
          {
            "Actions": [
              {
                "ActionType": "SHIFTSTART",
                "Day": 1,
                "StartLocationGeohash": "gcq59reuy8",
                "StartLatLon": [52.6885, -2.75213],
                "StartTime": "06:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "LOAD_UNLOAD",
                "Day": 1,
                "StartLocationGeohash": "gcq59reuy8",
                "StartLatLon": [52.6885, -2.75213],
                "StartTime": "06:00:00",
                "EndTime": "06:15:00",
                "Unload": [],
                "Load": ["0718.0718_18072020_B|364031858"],
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq59reuy8",
                "EndLocationGeohash": "gcq5bcsjbk",
                "StartLatLon": [52.6885, -2.75213],
                "EndLatLon": [52.7003, -2.77040],
                "StartTime": "06:15:00",
                "EndTime": "06:22:16",
                "DistanceKm": 3.278,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "WAIT",
                "Day": 1,
                "StartTime": "06:22:16",
                "EndTime": "08:00:00",
                "StartLocationGeohash": "gcq5bcsjbk",
                "StartLatLon": [52.7003, -2.77040],
                "WaitMinutes": 97.7215,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "0718.0718_18072020_B|364031858",
                "StartLocationGeohash": "gcq5bcsjbk",
                "StartLatLon": [52.7003, -2.77040],
                "StartTime": "08:00:00",
                "EndTime": "08:07:30",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5bcsjbk",
                "EndLocationGeohash": "gcq59reuy8",
                "StartLatLon": [52.7003, -2.77040],
                "EndLatLon": [52.6885, -2.75213],
                "StartTime": "08:07:30",
                "EndTime": "08:15:47",
                "DistanceKm": 3.424,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DEBRIEF",
                "Day": 1,
                "StartLocationGeohash": "gcq59reuy8",
                "StartLatLon": [52.6885, -2.75213],
                "StartTime": "08:15:47",
                "EndTime": "08:25:47",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "SHIFTEND",
                "Day": 1,
                "StartLocationGeohash": "gcq59reuy8",
                "StartLatLon": [52.6885, -2.75213],
                "StartTime": "08:25:47",
                "Overtime": "00:00:00",
                "ShiftOverload": 0,
                "Drivers": ["DRV_0718_0"]
              }
            ],
            "VehicleId": "VEH_0718_0"
          }
        ],
        "Objectives": {
          "CarbonKg": 0,
          "Cost": 357.547,
          "DistanceKm": 6.702,
          "PlannedJobsNumber": 1,
          "UnplannedJobsNumber": 0,
          "Penalties": 0,
          "ShiftsNumber": 1,
          "TravelTimeMinutes": 15.5696,
          "MeanMPH": 16.0483,
          "LateJobs": 0,
          "MeanLateMinutesPerLateJob": 0,
          "DriversWithOvertime": 0,
          "MeanOvertimePerDriversWithOvertime": 0,
          "OvertimeSecond": 0,
          "TotalTimeSecond": 8747.47,
          "TotalOverload": 0
        },
        "UnplannedJobs": []
      }
    ],
    "ExecutionTimeSecond": 60
  },
  "TimestampUnix": 1615205036,
  "ScheduleId": "4d3b83f413ee37abb64f66ab57a2f29833385b9c74eb3145de380b684934062b",
  "Finished": true,
  "State": "FINISH",
  "Id": 3424313,
  "StartDate": "2021-03-10",
  "EndDate": "2021-03-10",
  "RequestId": "4d3b83f413ee37abb64f66ab57a2f29833385b9c74eb3145de380b684934062b",
  "Issues": []
}

Retrieve the output plan for session: 0f38c3b1-82b9-5612-a1d0-42faf5d57258 and day: 2021-03-15.

Get Plan Updates

This can be done using WebSockets to save client app from polling EOS.

1. Get Plan updates in a session:

wscat -c "wss://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan/ws?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258"

WebSocket connection is open. Plan updates on all session dates will be sent through.

2. Get Plan updates on a specific plan date:

wscat -c "wss://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan/ws?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&PlanDate=2021-03-10"

WebSocket connection is open. Plan updates on the specified date only will be sent through.

Finalise Plan

Finalise a plan after 1800 seconds (30m) example:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan/finalise?apikey=$APIKEY_CORE03_UAT&SessionID=0f38c3b1-82b9-5612-a1d0-42faf5d57258&PlanDate=2021-03-10&DurationSeconds=1800" -H "accept: application/json"

Successful response:

"OK"

Finalise allows EOS to prepare for final plan calculation. It gives EOS a heads-up notification to finish optimisation for a specific session and day.

Basic Slot Booking Mode Example

1. Open a session and take note of the new session ID:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"Algorithm":"auto","BreaksMode":"Segmented","ContinueWithoutImprovementTime":"30s","Decompose":false,"DeleteExpiredSecond":604800,"FinalOutputChoice":"BestDistance","IdleTimeSecond":604800,"InterimOutputChoice":"BestDistance","LocationPrecision":10,"LocationPrecisionMetre":1,"MinimumTravelTime":"3m","NumDays":1,"OutputInterval":"15s","PARAMETER_OutputSeconds":true,"PlanAllJobs":true,"RoutingService":"OSRM","StatisticsInterval":"15s","TotalRunTime":"1m","WorkingTimeIncludesBreaks":true}'
{"SessionID":"004004a3-3044-5f15-8038-4bbddef44938"}

2. Add slots to the newly created session:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/daily?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartDate":"2021-01-01","DailyStartTime":"06:00","DailyEndTime":"18:00","EndDate":"2021-12-31","SlotDuration":"01:00","WeekDays":["Mon","Tue","Wed","Thu","Fri"]}]'
"OK"

3. Add one depot and one vehicle and driver pair available for a year:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"IdString":"0718","LocationLatLong":[52.617389,-2.687529]}],"Drivers":[{"CostPerDay":100,"CostPerHour":40,"DebriefingTime":"10m","DrivingBreakThreshold":"24h","IdString":"DRV_0718_0","MaximumWorkingTime":"12h","ShiftEarlyStartTime":"06:00:00","ShiftLateStartTime":"08:00:00","WorkQualifyingBreakDuration":"24h"}],"VehicleDriverMap":[{"Day":1,"DriverId":"DRV_0718_0","VehicleId":"VEH_0718_0"}],"VehicleProfiles":[{"MaximumSpeedKPH":91.7326,"SpeedProfiles":[{"SpeedFactor":0.79,"TimeFrom":"0m","TimeTo":"525m"},{"SpeedFactor":0.5,"TimeFrom":"525m","TimeTo":"1440m"}],"TransportMode":"car","Type":"VEH_PF_0718_0"}],"Vehicles":[{"Capacities":[943,27],"Characteristics":["0718"],"CostPerDay":100,"CostPerDayOfNonUse":0,"CostPerKm":10,"EndLocationLatLong":[52.617389,-2.687529],"IdString":"VEH_0718_0","StartLocationLatLong":[52.617389,-2.687529],"StartTime":"0m","SuppressDepotReload":true,"Type":"VEH_PF_0718_0"}]}'
"OK"

4. Get free slots given a job:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/available?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938&StartTime=2021-03-10T00:00:00&EndTime=2021-03-10T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"FixedVisitDuration":"450s","IdString":"JOB_1","LoadTime":"0m","LocationLatLong":[52.704037,-2.769494],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
[
  {
    "StartTime": "2021-03-10T06:00:00", "EndTime": "2021-03-10T07:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11120,
    "TimeToJobSecond": 479
  },
  {
    "StartTime": "2021-03-10T07:00:00", "EndTime": "2021-03-10T08:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11120,
    "TimeToJobSecond": 0
  },
  {
    "StartTime": "2021-03-10T08:00:00", "EndTime": "2021-03-10T09:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11120,
    "TimeToJobSecond": 0
  },
  {
    "StartTime": "2021-03-10T09:00:00", "EndTime": "2021-03-10T10:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11120,
    "TimeToJobSecond": 0
  }
]

5. Book the job in one of the available slots:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938&StartTime=2021-03-10T09:00:00&EndTime=2021-03-10T10:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"FixedVisitDuration":"450s","IdString":"JOB_1","LoadTime":"0m","LocationLatLong":[52.704037,-2.769494],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
"OK"

6. Get free slots for another job:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/available?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938&StartTime=2021-03-10T00:00:00&EndTime=2021-03-10T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"FixedVisitDuration":"450s","IdString":"JOB_2","LoadTime":"0m","LocationLatLong":[52.709300,-2.754007],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
[
  {
    "StartTime": "2021-03-10T06:00:00", "EndTime": "2021-03-10T07:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11172,
    "TimeToJobSecond": 482
  },
  {
    "StartTime": "2021-03-10T07:00:00", "EndTime": "2021-03-10T08:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11172,
    "TimeToJobSecond": 0
  },
  {
    "StartTime": "2021-03-10T08:00:00", "EndTime": "2021-03-10T09:00:00",
    "Status": "Open", "Utilisation": 0,
    "DistanceToJobMetre": 11172,
    "TimeToJobSecond": 0
  }
]

7. Book another job:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938&StartTime=2021-03-10T06:00:00&EndTime=2021-03-10T07:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"FixedVisitDuration":"450s","IdString":"JOB_2","LoadTime":"0m","LocationLatLong":[52.709300,-2.754007],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
"OK"

8. At this stage, plan can be finalised. However, for such a small plan it is not important. Get Plan:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=004004a3-3044-5f15-8038-4bbddef44938&PlanDate=2021-03-10" -H "accept: application/json"

{
  "Result": "SCHEDULES",
  "Data": {
    "SolutionSet": [
      {
        "Schedule": [
          {
            "Actions": [
              {
                "ActionType": "SHIFTSTART",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "LOAD_UNLOAD",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "EndTime": "06:00:00",
                "Unload": [],
                "Load": ["JOB_2", "JOB_1"],
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "EndLocationGeohash": "gcq5c76tfv",
                "StartLatLon": [52.6174, -2.68753],
                "EndLatLon": [52.7093, -2.75401],
                "StartTime": "06:00:00",
                "EndTime": "06:26:14",
                "DistanceKm": 14.49,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_2",
                "StartLocationGeohash": "gcq5c76tfv",
                "StartLatLon": [52.7093, -2.75401],
                "StartTime": "06:26:14",
                "EndTime": "06:33:44",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5c76tfv",
                "EndLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.7093, -2.75401],
                "EndLatLon": [52.704, -2.76949],
                "StartTime": "06:33:44",
                "EndTime": "06:38:54",
                "DistanceKm": 2.416,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "WAIT",
                "Day": 1,
                "StartTime": "06:38:54",
                "EndTime": "09:00:00",
                "StartLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.704, -2.76949],
                "WaitMinutes": 141.086,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_1",
                "StartLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.704, -2.76949],
                "StartTime": "09:00:00",
                "EndTime": "09:07:30",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5bfrr60",
                "EndLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.704, -2.76949],
                "EndLatLon": [52.6174, -2.68753],
                "StartTime": "09:07:30",
                "EndTime": "09:43:42",
                "DistanceKm": 14.073,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DEBRIEF",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "09:43:42",
                "EndTime": "09:53:42",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "SHIFTEND",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "09:53:42",
                "Overtime": "00:00:00",
                "ShiftOverload": 0,
                "Drivers": ["DRV_0718_0"]
              }
            ],
            "VehicleId": "VEH_0718_0"
          }
        ],
        "Objectives": {
          "CarbonKg": 0,
          "Cost": 658.923,
          "DistanceKm": 30.979,
          "PlannedJobsNumber": 2,
          "UnplannedJobsNumber": 0,
          "Penalties": 0,
          "ShiftsNumber": 1,
          "TravelTimeMinutes": 67.6135,
          "MeanMPH": 17.0819,
          "LateJobs": 0,
          "MeanLateMinutesPerLateJob": 0,
          "DriversWithOvertime": 0,
          "MeanOvertimePerDriversWithOvertime": 0,
          "OvertimeSecond": 0,
          "TotalTimeSecond": 14022,
          "TotalOverload": 0
        },
        "UnplannedJobs": []
      }
    ],
    "ExecutionTimeSecond": 30
  },
  "TimestampUnix": 1615214729,
  "ScheduleId": "b7b5b787235411faaa2860dd121340b98632da6ae706df2078e446c008259c93",
  "Finished": true,
  "State": "FINISH",
  "Id": 3424845,
  "StartDate": "2021-03-10",
  "EndDate": "2021-03-10",
  "RequestId": "6d92c1a524e2b616bc1f981cd381d08eed856f5e11b0d526109310de28ee1b0d",
  "Issues": []
}

Make sure Issues array is empty. The plan might not be up-to-date when optimisation errors exist.

In this section, a full example is provided. The objective is to go through all the necessary steps to get a plan successfully.







Notes:

Basic Dynamic Scheduling Mode Example

1. Open a session and take note of the new session ID:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"Algorithm":"auto","BreaksMode":"Segmented","ContinueWithoutImprovementTime":"30s","Decompose":false,"DeleteExpiredSecond":604800,"FinalOutputChoice":"BestDistance","IdleTimeSecond":604800,"InterimOutputChoice":"BestDistance","LocationPrecision":10,"LocationPrecisionMetre":1,"MinimumTravelTime":"3m","NumDays":1,"OutputInterval":"15s","PARAMETER_OutputSeconds":true,"PlanAllJobs":false,"RoutingService":"OSRM","StatisticsInterval":"15s","TotalRunTime":"1m","WorkingTimeIncludesBreaks":true}'
{"SessionID":"ab17cbe2-2dae-572b-a18c-db7a733a7949"}

2. Add one depot and one vehicle and driver pair available for a year:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=ab17cbe2-2dae-572b-a18c-db7a733a7949&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"IdString":"0718","LocationLatLong":[52.617389,-2.687529]}],"Drivers":[{"CostPerDay":100,"CostPerHour":40,"DebriefingTime":"10m","DrivingBreakThreshold":"24h","IdString":"DRV_0718_0","MaximumWorkingTime":"12h","ShiftEarlyStartTime":"06:00:00","ShiftLateStartTime":"08:00:00","WorkQualifyingBreakDuration":"24h"}],"VehicleDriverMap":[{"Day":1,"DriverId":"DRV_0718_0","VehicleId":"VEH_0718_0"}],"VehicleProfiles":[{"MaximumSpeedKPH":91.7326,"SpeedProfiles":[{"SpeedFactor":0.79,"TimeFrom":"0m","TimeTo":"525m"},{"SpeedFactor":0.5,"TimeFrom":"525m","TimeTo":"1440m"}],"TransportMode":"car","Type":"VEH_PF_0718_0"}],"Vehicles":[{"Capacities":[943,27],"Characteristics":["0718"],"CostPerDay":100,"CostPerDayOfNonUse":0,"CostPerKm":10,"EndLocationLatLong":[52.617389,-2.687529],"IdString":"VEH_0718_0","StartLocationLatLong":[52.617389,-2.687529],"StartTime":"0m","SuppressDepotReload":true,"Type":"VEH_PF_0718_0"}]}'
"OK"

Get Plan at this stage should return the Cannot find list of Jobs error:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=ab17cbe2-2dae-572b-a18c-db7a733a7949&PlanDate=2021-03-10" -H "accept: application/json"
{"Result":"SCHEDULES","ScheduleId":"9df102b2e7fdff18a2ca1fc7a632a7db2499e29afb2fcfec55d677057844f602","Data":{},"TimestampUnix":1615214636,"State":"FINISH","Finished":true,"Id":3424845,"StartDate":"2021-03-10","EndDate":"2021-03-10","RequestId":"b7b5b787235411faaa2860dd121340b98632da6ae706df2078e446c008259c93","Issues":["{\"Result\":\"ERROR\",\"Data\":{\"code\":400,\"message\":\"Cannot find list of Jobs\"},\"TimestampUnix\":1615214636,\"ScheduleId\":\"9df102b2e7fdff18a2ca1fc7a632a7db2499e29afb2fcfec55d677057844f602\",\"State\":\"FINISH\"}"]}

3. Add jobs:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=ab17cbe2-2dae-572b-a18c-db7a733a7949&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Jobs":[{"FixedVisitDuration":"450s","IdString":"JOB_1","LoadTime":"0m","LocationLatLong":[52.704037,-2.769494],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"},{"FixedVisitDuration":"450s","IdString":"JOB_2","LoadTime":"0m","LocationLatLong":[52.709300,-2.754007],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}]}'
"OK"

4. Get Current Plan:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=ab17cbe2-2dae-572b-a18c-db7a733a7949&PlanDate=2021-03-10" -H "accept: application/json"

Plan of 2 jobs:

{
  "Result": "SCHEDULES",
  "Data": {
    "SolutionSet": [
      {
        "Schedule": [
          {
            "Actions": [
              {
                "ActionType": "SHIFTSTART",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "LOAD_UNLOAD",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "EndTime": "06:00:00",
                "Unload": [],
                "Load": ["JOB_1", "JOB_2"],
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "EndLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.6174, -2.68753],
                "EndLatLon": [52.704, -2.76949],
                "StartTime": "06:00:00",
                "EndTime": "06:22:45",
                "DistanceKm": 14.094,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_1",
                "StartLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.704, -2.76949],
                "StartTime": "06:22:45",
                "EndTime": "06:30:15",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5bfrr60",
                "EndLocationGeohash": "gcq5c76tfv",
                "StartLatLon": [52.704, -2.76949],
                "EndLatLon": [52.7093, -2.75401],
                "StartTime": "06:30:15",
                "EndTime": "06:34:56",
                "DistanceKm": 2.22,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_2",
                "StartLocationGeohash": "gcq5c76tfv",
                "StartLatLon": [52.7093, -2.75401],
                "StartTime": "06:34:56",
                "EndTime": "06:42:26",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5c76tfv",
                "EndLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.7093, -2.75401],
                "EndLatLon": [52.6174, -2.68753],
                "StartTime": "06:42:26",
                "EndTime": "07:08:36",
                "DistanceKm": 14.489,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DEBRIEF",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "07:08:36",
                "EndTime": "07:18:36",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "SHIFTEND",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "07:18:36",
                "Overtime": "00:00:00",
                "ShiftOverload": 0,
                "Drivers": ["DRV_0718_0"]
              }
            ],
            "VehicleId": "VEH_0718_0"
          }
        ],
        "Objectives": {
          "CarbonKg": 0,
          "Cost": 553.768,
          "DistanceKm": 30.803,
          "PlannedJobsNumber": 2,
          "UnplannedJobsNumber": 0,
          "Penalties": 0,
          "ShiftsNumber": 1,
          "TravelTimeMinutes": 53.6076,
          "MeanMPH": 21.4225,
          "LateJobs": 0,
          "MeanLateMinutesPerLateJob": 0,
          "DriversWithOvertime": 0,
          "MeanOvertimePerDriversWithOvertime": 0,
          "OvertimeSecond": 0,
          "TotalTimeSecond": 4716.46,
          "TotalOverload": 0
        },
        "UnplannedJobs": []
      }
    ],
    "ExecutionTimeSecond": 30
  },
  "TimestampUnix": 1615217031,
  "ScheduleId": "ca3f19b1562ccc29f20fe06125328cf288a524a1daacb02f9a6524a14cf468ac",
  "Finished": true,
  "State": "FINISH",
  "RequestId": "ca3f19b1562ccc29f20fe06125328cf288a524a1daacb02f9a6524a14cf468ac",
  "Id": 3424967,
  "StartDate": "2021-03-10",
  "EndDate": "2021-03-10",
  "Issues": []
}

5. Add an extra job with time window:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=ab17cbe2-2dae-572b-a18c-db7a733a7949&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Jobs":[{"FixedVisitDuration":"5m","IdString":"JOB_3","LoadTime":"0m","LocationLatLong":[52.708912,-2.742510],"Quantities":[80.12,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m","TimeWindows":[{"Day":1,"Windows":[["09:00:00","10:00:00"]]}]}]}'
"OK"

6. Get Updated Plan:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=ab17cbe2-2dae-572b-a18c-db7a733a7949&PlanDate=2021-03-10" -H "accept: application/json"

Plan of 3 jobs:

{
  "Result": "SCHEDULES",
  "Data": {
    "SolutionSet": [
      {
        "Schedule": [
          {
            "Actions": [
              {
                "ActionType": "SHIFTSTART",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "LOAD_UNLOAD",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "EndTime": "06:00:00",
                "Unload": [],
                "Load": ["JOB_1", "JOB_2", "JOB_3"],
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "EndLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.6174, -2.68753],
                "EndLatLon": [52.704, -2.76949],
                "StartTime": "06:00:00",
                "EndTime": "06:24:11",
                "DistanceKm": 15.299,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_1",
                "StartLocationGeohash": "gcq5bfrr60",
                "StartLatLon": [52.704, -2.76949],
                "StartTime": "06:24:11",
                "EndTime": "06:31:41",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5bfrr60",
                "EndLocationGeohash": "gcq5c76tfv",
                "StartLatLon": [52.704, -2.76949],
                "EndLatLon": [52.7093, -2.75401],
                "StartTime": "06:31:41",
                "EndTime": "06:38:04",
                "DistanceKm": 2.177,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_2",
                "StartLocationGeohash": "gcq5c76tfv",
                "StartLatLon": [52.7093, -2.75401],
                "StartTime": "06:38:04",
                "EndTime": "06:45:34",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5c76tfv",
                "EndLocationGeohash": "gcq5ce6gwv",
                "StartLatLon": [52.7093, -2.75401],
                "EndLatLon": [52.7089, -2.74251],
                "StartTime": "06:45:34",
                "EndTime": "06:52:52",
                "DistanceKm": 1.836,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "WAIT",
                "Day": 1,
                "StartTime": "06:52:52",
                "EndTime": "09:00:00",
                "StartLocationGeohash": "gcq5ce6gwv",
                "StartLatLon": [52.7089, -2.74251],
                "WaitMinutes": 127.131,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_3",
                "StartLocationGeohash": "gcq5ce6gwv",
                "StartLatLon": [52.7089, -2.74251],
                "StartTime": "09:00:00",
                "EndTime": "09:05:00",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5ce6gwv",
                "EndLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.7089, -2.74251],
                "EndLatLon": [52.6174, -2.68753],
                "StartTime": "09:05:00",
                "EndTime": "09:43:00",
                "DistanceKm": 13.936,
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "DEBRIEF",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "09:43:00",
                "EndTime": "09:53:00",
                "Drivers": ["DRV_0718_0"]
              },
              {
                "ActionType": "SHIFTEND",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "09:53:00",
                "Overtime": "00:00:00",
                "ShiftOverload": 0,
                "Drivers": ["DRV_0718_0"]
              }
            ],
            "VehicleId": "VEH_0718_0"
          }
        ],
        "Objectives": {
          "CarbonKg": 0,
          "Cost": 681.147,
          "DistanceKm": 33.248,
          "PlannedJobsNumber": 3,
          "UnplannedJobsNumber": 0,
          "Penalties": 0,
          "ShiftsNumber": 1,
          "TravelTimeMinutes": 75.8692,
          "MeanMPH": 16.3382,
          "LateJobs": 0,
          "MeanLateMinutesPerLateJob": 0,
          "DriversWithOvertime": 0,
          "MeanOvertimePerDriversWithOvertime": 0,
          "OvertimeSecond": 0,
          "TotalTimeSecond": 13980,
          "TotalOverload": 0
        },
        "UnplannedJobs": []
      }
    ],
    "ExecutionTimeSecond": 15
  },
  "TimestampUnix": 1615220215,
  "ScheduleId": "de169fd65ed6c3ce9bcb5c86749cfa4cfea3de1697f402ecb10bc2dfb584efff",
  "State": "RUN",
  "EndDate": "2021-03-10",
  "RequestId": "de169fd65ed6c3ce9bcb5c86749cfa4cfea3de1697f402ecb10bc2dfb584efff",
  "Id": 3424967,
  "StartDate": "2021-03-10",
  "Issues": []
}

EOS can act as a dynamic scheduler without the need to define and book slots. In this mode, jobs usually added as batches or individually using the resources end-points. However, it is faster to add all known jobs as one batch instead of adding one by one.







Notes:

Basic Job transfer Example

1. Open a context and take a note of the new context ID:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session_context?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"TransferJobsBetweenSessions":true}'
{"ContextID":"22574a04-5e1e-5769-981a-2401018dc877"}

2. Open two sessions under the previous context:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"ContextID": "22574a04-5e1e-5769-981a-2401018dc877", "Algorithm":"auto","BreaksMode":"Segmented","ContinueWithoutImprovementTime":"30s","Decompose":false,"DeleteExpiredSecond":604800,"FinalOutputChoice":"BestDistance","IdleTimeSecond":604800,"InterimOutputChoice":"BestDistance","LocationPrecision":10,"LocationPrecisionMetre":1,"MinimumTravelTime":"3m","NumDays":1,"OutputInterval":"15s","PARAMETER_OutputSeconds":true,"PlanAllJobs":true,"RoutingService":"OSRM","StatisticsInterval":"15s","TotalRunTime":"1m","WorkingTimeIncludesBreaks":true}'
{"SessionID":"6155a0a2-6a1b-5a52-b6a2-a823011bda26"}
curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/session?apikey=$APIKEY_CORE03_UAT" -H "Content-Type: application/json" -d '{"ContextID": "22574a04-5e1e-5769-981a-2401018dc877", "Algorithm":"auto","BreaksMode":"Segmented","ContinueWithoutImprovementTime":"30s","Decompose":false,"DeleteExpiredSecond":604800,"FinalOutputChoice":"BestDistance","IdleTimeSecond":604800,"InterimOutputChoice":"BestDistance","LocationPrecision":10,"LocationPrecisionMetre":1,"MinimumTravelTime":"3m","NumDays":1,"OutputInterval":"15s","PARAMETER_OutputSeconds":true,"PlanAllJobs":true,"RoutingService":"OSRM","StatisticsInterval":"15s","TotalRunTime":"1m","WorkingTimeIncludesBreaks":true}'
{"SessionID":"13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398"}

3. Add slots to both sessions:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/daily?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartDate":"2021-01-01","DailyStartTime":"06:00","DailyEndTime":"18:00","EndDate":"2021-12-31","SlotDuration":"01:00","WeekDays":["Mon","Tue","Wed","Thu","Fri"]}]'
"OK"
curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/daily?apikey=$APIKEY_CORE03_UAT&SessionID=13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"StartDate":"2021-01-01","DailyStartTime":"06:00","DailyEndTime":"18:00","EndDate":"2021-12-31","SlotDuration":"01:00","WeekDays":["Mon","Tue","Wed","Thu","Fri"]}]'
"OK"

4. Add resources to both sessions. Each session is configured with one depot and one vehicle/driver pair.

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"IdString":"DPT_1","LocationLatLong":[52.617389,-2.687529],"Characteristics":["DPT_1"]}],"Drivers":[{"CostPerDay":0,"CostPerHour":0,"DebriefingTime":"10m","DrivingBreakThreshold":"24h","IdString":"DRV_DPT_1_0","MaximumWorkingTime":"12h","ShiftEarlyStartTime":"05:00:00","ShiftLateStartTime":"08:00:00","WorkQualifyingBreakDuration":"24h"}],"VehicleDriverMap":[{"Day":1,"DriverId":"DRV_DPT_1_0","VehicleId":"VEH_DPT_1_0"}],"VehicleProfiles":[{"MaximumSpeedKPH":91.7326,"SpeedProfiles":[{"SpeedFactor":0.79,"TimeFrom":"0m","TimeTo":"525m"},{"SpeedFactor":0.5,"TimeFrom":"525m","TimeTo":"1440m"}],"TransportMode":"car","Type":"VEH_PF_DPT_1_0"}],"Vehicles":[{"Capacities":[943,27],"Characteristics":["DPT_1"],"CostPerDay":0,"CostPerDayOfNonUse":0,"CostPerKm":10,"EndLocationLatLong":[52.617389,-2.687529],"IdString":"VEH_DPT_1_0","StartLocationLatLong":[52.617389,-2.687529],"StartTime":"0m","SuppressDepotReload":true,"Type":"VEH_PF_DPT_1_0"}]}'
"OK"
curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/resources?apikey=$APIKEY_CORE03_UAT&SessionID=13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398&StartDate=2021-01-01&EndDate=2031-12-31" -H "accept: application/json" -H "Content-Type: application/json" -d '{"Depots":[{"IdString":"DPT_2","LocationLatLong":[52.807454,-2.117646],"Characteristics":["DPT_2"]}],"Drivers":[{"CostPerDay":0,"CostPerHour":0,"DebriefingTime":"10m","DrivingBreakThreshold":"24h","IdString":"DRV_DPT_2_0","MaximumWorkingTime":"12h","ShiftEarlyStartTime":"05:00:00","ShiftLateStartTime":"08:00:00","WorkQualifyingBreakDuration":"24h"}],"VehicleDriverMap":[{"Day":1,"DriverId":"DRV_DPT_2_0","VehicleId":"VEH_DPT_2_0"}],"VehicleProfiles":[{"MaximumSpeedKPH":91.7326,"SpeedProfiles":[{"SpeedFactor":0.79,"TimeFrom":"0m","TimeTo":"525m"},{"SpeedFactor":0.65,"TimeFrom":"525m","TimeTo":"1440m"}],"TransportMode":"car","Type":"VEH_PF_DPT_2_0"}],"Vehicles":[{"Capacities":[943,27],"Characteristics":["DPT_2"],"CostPerDay":0,"CostPerDayOfNonUse":0,"CostPerKm":10,"EndLocationLatLong":[52.807454,-2.117646],"IdString":"VEH_DPT_2_0","StartLocationLatLong":[52.807454,-2.117646],"StartTime":"0m","SuppressDepotReload":true,"Type":"VEH_PF_DPT_2_0"}]}'
"OK"

5. Get free slots in session 6155a0a2-6a1b-5a52-b6a2-a823011bda26 (DPT_1), for a job close to DPT_1:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/available?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T00:00:00&EndTime=2021-04-01T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_1","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.706305,-2.746374],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
[
  {"StartTime":"2021-04-01T06:00:00","EndTime":"2021-04-01T07:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":10665,"TimeToJobSecond":459},
  {"StartTime":"2021-04-01T07:00:00","EndTime":"2021-04-01T08:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":10665,"TimeToJobSecond":0},
  {"StartTime":"2021-04-01T08:00:00","EndTime":"2021-04-01T09:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":10665,"TimeToJobSecond":0},
  {"StartTime":"2021-04-01T09:00:00","EndTime":"2021-04-01T10:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":10665,"TimeToJobSecond":0}
]

6. Book a job in the first session 6155a0a2-6a1b-5a52-b6a2-a823011bda26:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T07:00:00&EndTime=2021-04-01T08:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_1","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.706305,-2.746374],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
"OK"

Note: the job is configured with IncludeDepotCharacteristics set to both depots characteristics DPT_1 and DPT_2. So, EOS can freely transfer this job between the two depots.

7. Get free slots in second session 13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/available?apikey=$APIKEY_CORE03_UAT&SessionID=13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398&StartTime=2021-04-01T00:00:00&EndTime=2021-04-01T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_S2_1","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.764523,-2.375986],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
[
  {"StartTime":"2021-04-01T06:00:00","EndTime":"2021-04-01T07:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":18037,"TimeToJobSecond":778},
  {"StartTime":"2021-04-01T07:00:00","EndTime":"2021-04-01T08:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":18037,"TimeToJobSecond":0},
  {"StartTime":"2021-04-01T08:00:00","EndTime":"2021-04-01T09:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":18037,"TimeToJobSecond":0},
  {"StartTime":"2021-04-01T09:00:00","EndTime":"2021-04-01T10:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":18037,"TimeToJobSecond":0}
]

8. Book a job in the second session 13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398&StartTime=2021-04-01T06:00:00&EndTime=2021-04-01T07:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_S2_1","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.764523,-2.375986],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
"OK"

9. Get Slots in first session to see how busy the plan in the morning is:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T06:00:00&EndTime=2021-04-01T09:00:00"
[
  {"StartTime":"2021-04-01T06:00:00","EndTime":"2021-04-01T07:00:00","Status":"Open","Utilisation":0.37,"NumberOfJobs":0},
  {"StartTime":"2021-04-01T07:00:00","EndTime":"2021-04-01T08:00:00","Status":"Open","Utilisation":0.66,"NumberOfJobs":1,"Jobs":["JOB_1"]},
  {"StartTime":"2021-04-01T08:00:00","EndTime":"2021-04-01T09:00:00","Status":"Open","Utilisation":0,"NumberOfJobs":0}
]

10. Book slot 2021-04-01T07:00:00,2021-04-01T08:00:00 in the first session 6155a0a2-6a1b-5a52-b6a2-a823011bda26 (DPT_1), for a job close to DPT_2 in second session:

So EOS should transfer this job to the second session in 10m time:

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T07:00:00&EndTime=2021-04-01T08:00:00&Force=true" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_2","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.807895,-2.116664],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
"OK"

Note: the job is forced here to make sure it is booked, in real-time situations, Forced should not enabled.

11. Book another job in the first session as well to make things a bit more busy.

Note: Job transfer is only triggered for jobs with slot utilisation greater than 50%. This prevents premature job transfer from happening.

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/available?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T00:00:00&EndTime=2021-04-01T09:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_3","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.708315,-2.751889],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
[
  {"StartTime":"2021-04-01T06:00:00","EndTime":"2021-04-01T07:00:00","Status":"Open","Utilisation":0.37,"DistanceToJobMetre":11015,"TimeToJobSecond":806},
  {"StartTime":"2021-04-01T07:00:00","EndTime":"2021-04-01T08:00:00","Status":"Open","Utilisation":0.66,"DistanceToJobMetre":434,"TimeToJobSecond":35},
  {"StartTime":"2021-04-01T08:00:00","EndTime":"2021-04-01T09:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":11015,"TimeToJobSecond":0},
  {"StartTime":"2021-04-01T09:00:00","EndTime":"2021-04-01T10:00:00","Status":"Open","Utilisation":0,"DistanceToJobMetre":11015,"TimeToJobSecond":0}
]

From the look of the returned slots, it seems that JOB_2 has already beed transferred to the second session. However, EOS is a dynamic system. It might need more time to transfer jobs; so, free slots might be different at the time the previous method is executed.

Let us book a new job JOB_3 to slot 2021-04-01T06:00:00,2021-04-01T07:00:00

curl -X POST "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots/book?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T06:00:00&EndTime=2021-04-01T07:00:00" -H "accept: application/json" -H "Content-Type: application/json" -d '{"IdString":"JOB_3","IncludeDepotCharacteristics":[["DPT_1"],["DPT_2"]],"FixedVisitDuration":"450s","LoadTime":"0m","LocationLatLong":[52.708315,-2.751889],"Quantities":[69.68,1],"RevenueIncome":1000,"Service":"delivery","ServiceVisitDuration":"0m"}'
"OK"

12. After few minutes, get slots to see how busy the plan in the morning is for both sessions:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&StartTime=2021-04-01T06:00:00&EndTime=2021-04-01T09:00:00"
[
  {"StartTime":"2021-04-01T06:00:00","EndTime":"2021-04-01T07:00:00","Status":"Open","Utilisation":0.6,"NumberOfJobs":1,"Jobs":["JOB_3"]},
  {"StartTime":"2021-04-01T07:00:00","EndTime":"2021-04-01T08:00:00","Status":"Open","Utilisation":0.66,"NumberOfJobs":1,"Jobs":["JOB_1"]},
  {"StartTime":"2021-04-01T08:00:00","EndTime":"2021-04-01T09:00:00","Status":"Open","Utilisation":0,"NumberOfJobs":0}
]
curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/slots?apikey=$APIKEY_CORE03_UAT&SessionID=13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398&StartTime=2021-04-01T06:00:00&EndTime=2021-04-01T09:00:00"
[
  {"StartTime":"2021-04-01T06:00:00","EndTime":"2021-04-01T07:00:00","Status":"Open","Utilisation":0.97,"NumberOfJobs":1,"Jobs":["JOB_S2_1"]},
  {"StartTime":"2021-04-01T07:00:00","EndTime":"2021-04-01T08:00:00","Status":"Open","Utilisation":0.34,"NumberOfJobs":1,"Jobs":["JOB_2"]},
  {"StartTime":"2021-04-01T08:00:00","EndTime":"2021-04-01T09:00:00","Status":"Open","Utilisation":0,"NumberOfJobs":0}
]

It seems JOB_2 is successfully transferred into second session 13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398.

13. Get Plans from both sessions:

curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=6155a0a2-6a1b-5a52-b6a2-a823011bda26&PlanDate=2021-04-01" -H "accept: application/json"
{
  "Result": "SCHEDULES",
  "Data": {
    "SolutionSet": [
      {
        "Schedule": [
          {
            "Actions": [
              {
                "ActionType": "SHIFTSTART",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "LOAD_UNLOAD",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "06:00:00",
                "EndTime": "06:00:00",
                "Unload": [],
                "Load": ["JOB_3", "JOB_1"],
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "EndLocationGeohash": "gcq5c7k0hq",
                "StartLatLon": [52.6174, -2.68753],
                "EndLatLon": [52.7083, -2.75189],
                "StartTime": "06:00:00",
                "EndTime": "06:25:31",
                "DistanceKm": 13.873,
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_3",
                "StartLocationGeohash": "gcq5c7k0hq",
                "StartLatLon": [52.7083, -2.75189],
                "StartTime": "06:25:31",
                "EndTime": "06:33:01",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5c7k0hq",
                "EndLocationGeohash": "gcq5cdbhkz",
                "StartLatLon": [52.7083, -2.75189],
                "EndLatLon": [52.7063, -2.74637],
                "StartTime": "06:33:01",
                "EndTime": "06:36:01",
                "DistanceKm": 0.83,
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "WAIT",
                "Day": 1,
                "StartTime": "06:36:01",
                "EndTime": "07:00:00",
                "StartLocationGeohash": "gcq5cdbhkz",
                "StartLatLon": [52.7063, -2.74637],
                "WaitMinutes": 23.9726,
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_1",
                "StartLocationGeohash": "gcq5cdbhkz",
                "StartLatLon": [52.7063, -2.74637],
                "StartTime": "07:00:00",
                "EndTime": "07:07:30",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcq5cdbhkz",
                "EndLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.7063, -2.74637],
                "EndLatLon": [52.6174, -2.68753],
                "StartTime": "07:07:30",
                "EndTime": "07:29:40",
                "DistanceKm": 13.139,
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "DEBRIEF",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "07:29:40",
                "EndTime": "07:39:40",
                "Drivers": ["DRV_DPT_1_0"]
              },
              {
                "ActionType": "SHIFTEND",
                "Day": 1,
                "StartLocationGeohash": "gcq56fen80",
                "StartLatLon": [52.6174, -2.68753],
                "StartTime": "07:39:40",
                "Overtime": "00:00:00",
                "ShiftOverload": 0,
                "Drivers": ["DRV_DPT_1_0"]
              }
            ],
            "VehicleId": "VEH_DPT_1_0"
          }
        ],
        "Objectives": {
          "CarbonKg":0,"Cost":538.202,"DistanceKm":27.842,"PlannedJobsNumber":2,"UnplannedJobsNumber":0,
          "Penalties":0,"ShiftsNumber":1,"TravelTimeMinutes":50.7004,"MeanMPH":20.4735,"LateJobs":0,
          "MeanLateMinutesPerLateJob":0,"DriversWithOvertime":0,"MeanOvertimePerDriversWithOvertime":0,
          "OvertimeSecond":0,"TotalTimeSecond":5980.38,"TotalOverload":0
        },
        "UnplannedJobs": []
      }
    ],
    "ExecutionTimeSecond": 30
  },
  "TimestampUnix": 1615477587,
  "ScheduleId": "c2c9103acbfe62a2c96049d8297ec8dd322e1db9bc4bdce53df0ad0563c9570d",
  "Finished": true,
  "State": "FINISH",
  "RequestId": "c2c9103acbfe62a2c96049d8297ec8dd322e1db9bc4bdce53df0ad0563c9570d",
  "Id": 3517287,
  "StartDate": "2021-04-01",
  "EndDate": "2021-04-01",
  "Issues": []
}
curl -X GET "https://api-core03-uat.trakm8.net:8443/bdservices/vortexonline/api/latest/api_v1/plan?apikey=$APIKEY_CORE03_UAT&SessionID=13eaeb4e-3dea-5f2a-8cd9-6c91c5c99398&PlanDate=2021-04-01" -H "accept: application/json"
{
  "Result": "SCHEDULES",
  "Data": {
    "SolutionSet": [
      {
        "Schedule": [
          {
            "Actions": [
              {
                "ActionType": "SHIFTSTART",
                "Day": 1,
                "StartLocationGeohash": "gcqkrv3cxq",
                "StartLatLon": [52.8074, -2.11764],
                "StartTime": "06:00:00",
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "LOAD_UNLOAD",
                "Day": 1,
                "StartLocationGeohash": "gcqkrv3cxq",
                "StartLatLon": [52.8074, -2.11764],
                "StartTime": "06:00:00",
                "EndTime": "06:00:00",
                "Unload": [],
                "Load": ["JOB_S2_1", "JOB_2"],
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcqkrv3cxq",
                "EndLocationGeohash": "gcqk1vmzee",
                "StartLatLon": [52.8074, -2.11764],
                "EndLatLon": [52.7645, -2.37598],
                "StartTime": "06:00:00",
                "EndTime": "06:24:56",
                "DistanceKm": 21.771,
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_S2_1",
                "StartLocationGeohash": "gcqk1vmzee",
                "StartLatLon": [52.7645, -2.37598],
                "StartTime": "06:24:56",
                "EndTime": "06:32:26",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcqk1vmzee",
                "EndLocationGeohash": "gcqkrv6sq1",
                "StartLatLon": [52.7645, -2.37598],
                "EndLatLon": [52.8079, -2.11667],
                "StartTime": "06:32:26",
                "EndTime": "06:58:18",
                "DistanceKm": 22.536,
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "WAIT",
                "Day": 1,
                "StartTime": "06:58:18",
                "EndTime": "07:00:00",
                "StartLocationGeohash": "gcqkrv6sq1",
                "StartLatLon": [52.8079, -2.11667],
                "WaitMinutes": 1.69831,
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "DELIVER",
                "Day": 1,
                "IdString": "JOB_2",
                "StartLocationGeohash": "gcqkrv6sq1",
                "StartLatLon": [52.8079, -2.11667],
                "StartTime": "07:00:00",
                "EndTime": "07:07:30",
                "MinutesLate": "00:00:00",
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "TRAVEL",
                "Day": 1,
                "StartLocationGeohash": "gcqkrv6sq1",
                "EndLocationGeohash": "gcqkrv3cxq",
                "StartLatLon": [52.8079, -2.11667],
                "EndLatLon": [52.8074, -2.11764],
                "StartTime": "07:07:30",
                "EndTime": "07:10:30",
                "DistanceKm": 0.511,
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "DEBRIEF",
                "Day": 1,
                "StartLocationGeohash": "gcqkrv3cxq",
                "StartLatLon": [52.8074, -2.11764],
                "StartTime": "07:10:30",
                "EndTime": "07:20:30",
                "Drivers": ["DRV_DPT_2_0"]
              },
              {
                "ActionType": "SHIFTEND",
                "Day": 1,
                "StartLocationGeohash": "gcqkrv3cxq",
                "StartLatLon": [52.8074, -2.11764],
                "StartTime": "07:20:30",
                "Overtime": "00:00:00",
                "ShiftOverload": 0,
                "Drivers": ["DRV_DPT_2_0"]
              }
            ],
            "VehicleId": "VEH_DPT_2_0"
          }
        ],
        "Objectives": {
          "CarbonKg":0,"Cost":695.18,"DistanceKm":44.818,"PlannedJobsNumber":2,"UnplannedJobsNumber":0,
          "Penalties":0,"ShiftsNumber":1,"TravelTimeMinutes":53.8017,"MeanMPH":31.057,"LateJobs":0,
          "MeanLateMinutesPerLateJob":0,"DriversWithOvertime":0,"MeanOvertimePerDriversWithOvertime":0,
          "OvertimeSecond":0,"TotalTimeSecond":4830,"TotalOverload":0
        },
        "UnplannedJobs": []
      }
    ],
    "ExecutionTimeSecond": 30
  },
  "TimestampUnix": 1615476056,
  "ScheduleId": "352b5186092f2a1c23224e62f67f161afb71ed35cf89c1283611337f5e727a46",
  "Finished": true,
  "State": "FINISH",
  "Id": 3517301,
  "StartDate": "2021-04-01",
  "EndDate": "2021-04-01",
  "RequestId": "352b5186092f2a1c23224e62f67f161afb71ed35cf89c1283611337f5e727a46",
  "Issues": []
}

In this section a full example with job transfer is illustrated. Job transfer requires a context and at least two session.