curl --request POST \
--url https://apiweb.mile.app/api/v3/routing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Result 01-24-2023 02:54:09",
"hubId": "6352736c628401059b37a2e2",
"hubCoordinate": "-6.17148,106.82649",
"configuration": {
"name": "Configuration Default",
"capacityConstraint": [
"weight",
"width",
"volume"
],
"multitrip": false,
"returnToHub": false,
"clustering": "none",
"useAllVehicle": false,
"autoSpeed": false,
"defaultSpeed": 10,
"defaultVisitTime": 10,
"autoSplit": "none",
"autoMerge": false,
"crossDockingType": "all",
"subHubs": [
{
"id": "660ce14bf7613e566145fe86",
"name": "Testing",
"address": "Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia",
"coordinate": "-6.84337,108.71348"
}
],
"multidayOption": "from hub",
"useOddEven": true,
"oddEvenTime": [
{
"startTime": "07:00",
"endTime": "10:00"
},
{
"startTime": "17:00",
"endTime": "20:00"
}
]
},
"routingDate": "2023-08-08",
"resultCode": "Route-20230801-001",
"visits": [
{
"id": "taskId-6311cc36db29775ad01694e6",
"name": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.230815251666679,106.75684387903198",
"timeWindow": {
"startTime": "08:00:00",
"endTime": "16:00:00"
},
"visitTime": 10,
"capacity": {
"weight": 100,
"volume": 150
},
"tags": [
"Even",
"East"
]
},
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindows": [
{
"startTime": "08:00:00",
"endTime": "16:00:00"
}
],
"visitTime": 10,
"capacity": {
"weight": 2500,
"volume": 6000
},
"tags": [
"Even",
"East"
]
}
],
"vehicles": [
{
"id": "6352736c628401059b37a2e2",
"name": "B001ACB",
"assignee": "miguel@mile.app",
"capacity": {
"weight": {
"max": 300,
"min": 0
},
"volume": {
"max": 1000,
"min": 0
}
},
"tags": [
"Even",
"East"
],
"speed": 15,
"fixedCost": 0,
"oddEven": "even",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
}
}
],
"background": true
}
'import requests
url = "https://apiweb.mile.app/api/v3/routing"
payload = {
"name": "Result 01-24-2023 02:54:09",
"hubId": "6352736c628401059b37a2e2",
"hubCoordinate": "-6.17148,106.82649",
"configuration": {
"name": "Configuration Default",
"capacityConstraint": ["weight", "width", "volume"],
"multitrip": False,
"returnToHub": False,
"clustering": "none",
"useAllVehicle": False,
"autoSpeed": False,
"defaultSpeed": 10,
"defaultVisitTime": 10,
"autoSplit": "none",
"autoMerge": False,
"crossDockingType": "all",
"subHubs": [
{
"id": "660ce14bf7613e566145fe86",
"name": "Testing",
"address": "Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia",
"coordinate": "-6.84337,108.71348"
}
],
"multidayOption": "from hub",
"useOddEven": True,
"oddEvenTime": [
{
"startTime": "07:00",
"endTime": "10:00"
},
{
"startTime": "17:00",
"endTime": "20:00"
}
]
},
"routingDate": "2023-08-08",
"resultCode": "Route-20230801-001",
"visits": [
{
"id": "taskId-6311cc36db29775ad01694e6",
"name": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.230815251666679,106.75684387903198",
"timeWindow": {
"startTime": "08:00:00",
"endTime": "16:00:00"
},
"visitTime": 10,
"capacity": {
"weight": 100,
"volume": 150
},
"tags": ["Even", "East"]
},
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindows": [
{
"startTime": "08:00:00",
"endTime": "16:00:00"
}
],
"visitTime": 10,
"capacity": {
"weight": 2500,
"volume": 6000
},
"tags": ["Even", "East"]
}
],
"vehicles": [
{
"id": "6352736c628401059b37a2e2",
"name": "B001ACB",
"assignee": "miguel@mile.app",
"capacity": {
"weight": {
"max": 300,
"min": 0
},
"volume": {
"max": 1000,
"min": 0
}
},
"tags": ["Even", "East"],
"speed": 15,
"fixedCost": 0,
"oddEven": "even",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
}
}
],
"background": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Result 01-24-2023 02:54:09',
hubId: '6352736c628401059b37a2e2',
hubCoordinate: '-6.17148,106.82649',
configuration: {
name: 'Configuration Default',
capacityConstraint: ['weight', 'width', 'volume'],
multitrip: false,
returnToHub: false,
clustering: 'none',
useAllVehicle: false,
autoSpeed: false,
defaultSpeed: 10,
defaultVisitTime: 10,
autoSplit: 'none',
autoMerge: false,
crossDockingType: 'all',
subHubs: [
{
id: '660ce14bf7613e566145fe86',
name: 'Testing',
address: 'Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia',
coordinate: '-6.84337,108.71348'
}
],
multidayOption: 'from hub',
useOddEven: true,
oddEvenTime: [{startTime: '07:00', endTime: '10:00'}, {startTime: '17:00', endTime: '20:00'}]
},
routingDate: '2023-08-08',
resultCode: 'Route-20230801-001',
visits: [
{
id: 'taskId-6311cc36db29775ad01694e6',
name: 'Visit 1',
address: 'Neo Soho, Jakarta Barat',
coordinate: '-6.230815251666679,106.75684387903198',
timeWindow: {startTime: '08:00:00', endTime: '16:00:00'},
visitTime: 10,
capacity: {weight: 100, volume: 150},
tags: ['Even', 'East']
},
{
id: 'taskId-63970a49cc6ae973f90929e2',
name: 'Visit 2',
address: 'Gambir Jakarta',
coordinate: '-6.17148,106.82649',
timeWindows: [{startTime: '08:00:00', endTime: '16:00:00'}],
visitTime: 10,
capacity: {weight: 2500, volume: 6000},
tags: ['Even', 'East']
}
],
vehicles: [
{
id: '6352736c628401059b37a2e2',
name: 'B001ACB',
assignee: 'miguel@mile.app',
capacity: {weight: {max: 300, min: 0}, volume: {max: 1000, min: 0}},
tags: ['Even', 'East'],
speed: 15,
fixedCost: 0,
oddEven: 'even',
workingTime: {startTime: '08:00', endTime: '17:00'}
}
],
background: true
})
};
fetch('https://apiweb.mile.app/api/v3/routing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/routing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Result 01-24-2023 02:54:09',
'hubId' => '6352736c628401059b37a2e2',
'hubCoordinate' => '-6.17148,106.82649',
'configuration' => [
'name' => 'Configuration Default',
'capacityConstraint' => [
'weight',
'width',
'volume'
],
'multitrip' => false,
'returnToHub' => false,
'clustering' => 'none',
'useAllVehicle' => false,
'autoSpeed' => false,
'defaultSpeed' => 10,
'defaultVisitTime' => 10,
'autoSplit' => 'none',
'autoMerge' => false,
'crossDockingType' => 'all',
'subHubs' => [
[
'id' => '660ce14bf7613e566145fe86',
'name' => 'Testing',
'address' => 'Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia',
'coordinate' => '-6.84337,108.71348'
]
],
'multidayOption' => 'from hub',
'useOddEven' => true,
'oddEvenTime' => [
[
'startTime' => '07:00',
'endTime' => '10:00'
],
[
'startTime' => '17:00',
'endTime' => '20:00'
]
]
],
'routingDate' => '2023-08-08',
'resultCode' => 'Route-20230801-001',
'visits' => [
[
'id' => 'taskId-6311cc36db29775ad01694e6',
'name' => 'Visit 1',
'address' => 'Neo Soho, Jakarta Barat',
'coordinate' => '-6.230815251666679,106.75684387903198',
'timeWindow' => [
'startTime' => '08:00:00',
'endTime' => '16:00:00'
],
'visitTime' => 10,
'capacity' => [
'weight' => 100,
'volume' => 150
],
'tags' => [
'Even',
'East'
]
],
[
'id' => 'taskId-63970a49cc6ae973f90929e2',
'name' => 'Visit 2',
'address' => 'Gambir Jakarta',
'coordinate' => '-6.17148,106.82649',
'timeWindows' => [
[
'startTime' => '08:00:00',
'endTime' => '16:00:00'
]
],
'visitTime' => 10,
'capacity' => [
'weight' => 2500,
'volume' => 6000
],
'tags' => [
'Even',
'East'
]
]
],
'vehicles' => [
[
'id' => '6352736c628401059b37a2e2',
'name' => 'B001ACB',
'assignee' => 'miguel@mile.app',
'capacity' => [
'weight' => [
'max' => 300,
'min' => 0
],
'volume' => [
'max' => 1000,
'min' => 0
]
],
'tags' => [
'Even',
'East'
],
'speed' => 15,
'fixedCost' => 0,
'oddEven' => 'even',
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00'
]
]
],
'background' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/routing"
payload := strings.NewReader("{\n \"name\": \"Result 01-24-2023 02:54:09\",\n \"hubId\": \"6352736c628401059b37a2e2\",\n \"hubCoordinate\": \"-6.17148,106.82649\",\n \"configuration\": {\n \"name\": \"Configuration Default\",\n \"capacityConstraint\": [\n \"weight\",\n \"width\",\n \"volume\"\n ],\n \"multitrip\": false,\n \"returnToHub\": false,\n \"clustering\": \"none\",\n \"useAllVehicle\": false,\n \"autoSpeed\": false,\n \"defaultSpeed\": 10,\n \"defaultVisitTime\": 10,\n \"autoSplit\": \"none\",\n \"autoMerge\": false,\n \"crossDockingType\": \"all\",\n \"subHubs\": [\n {\n \"id\": \"660ce14bf7613e566145fe86\",\n \"name\": \"Testing\",\n \"address\": \"Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia\",\n \"coordinate\": \"-6.84337,108.71348\"\n }\n ],\n \"multidayOption\": \"from hub\",\n \"useOddEven\": true,\n \"oddEvenTime\": [\n {\n \"startTime\": \"07:00\",\n \"endTime\": \"10:00\"\n },\n {\n \"startTime\": \"17:00\",\n \"endTime\": \"20:00\"\n }\n ]\n },\n \"routingDate\": \"2023-08-08\",\n \"resultCode\": \"Route-20230801-001\",\n \"visits\": [\n {\n \"id\": \"taskId-6311cc36db29775ad01694e6\",\n \"name\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.230815251666679,106.75684387903198\",\n \"timeWindow\": {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n },\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 100,\n \"volume\": 150\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n },\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindows\": [\n {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n }\n ],\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 2500,\n \"volume\": 6000\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n }\n ],\n \"vehicles\": [\n {\n \"id\": \"6352736c628401059b37a2e2\",\n \"name\": \"B001ACB\",\n \"assignee\": \"miguel@mile.app\",\n \"capacity\": {\n \"weight\": {\n \"max\": 300,\n \"min\": 0\n },\n \"volume\": {\n \"max\": 1000,\n \"min\": 0\n }\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ],\n \"speed\": 15,\n \"fixedCost\": 0,\n \"oddEven\": \"even\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n }\n }\n ],\n \"background\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/routing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Result 01-24-2023 02:54:09\",\n \"hubId\": \"6352736c628401059b37a2e2\",\n \"hubCoordinate\": \"-6.17148,106.82649\",\n \"configuration\": {\n \"name\": \"Configuration Default\",\n \"capacityConstraint\": [\n \"weight\",\n \"width\",\n \"volume\"\n ],\n \"multitrip\": false,\n \"returnToHub\": false,\n \"clustering\": \"none\",\n \"useAllVehicle\": false,\n \"autoSpeed\": false,\n \"defaultSpeed\": 10,\n \"defaultVisitTime\": 10,\n \"autoSplit\": \"none\",\n \"autoMerge\": false,\n \"crossDockingType\": \"all\",\n \"subHubs\": [\n {\n \"id\": \"660ce14bf7613e566145fe86\",\n \"name\": \"Testing\",\n \"address\": \"Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia\",\n \"coordinate\": \"-6.84337,108.71348\"\n }\n ],\n \"multidayOption\": \"from hub\",\n \"useOddEven\": true,\n \"oddEvenTime\": [\n {\n \"startTime\": \"07:00\",\n \"endTime\": \"10:00\"\n },\n {\n \"startTime\": \"17:00\",\n \"endTime\": \"20:00\"\n }\n ]\n },\n \"routingDate\": \"2023-08-08\",\n \"resultCode\": \"Route-20230801-001\",\n \"visits\": [\n {\n \"id\": \"taskId-6311cc36db29775ad01694e6\",\n \"name\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.230815251666679,106.75684387903198\",\n \"timeWindow\": {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n },\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 100,\n \"volume\": 150\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n },\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindows\": [\n {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n }\n ],\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 2500,\n \"volume\": 6000\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n }\n ],\n \"vehicles\": [\n {\n \"id\": \"6352736c628401059b37a2e2\",\n \"name\": \"B001ACB\",\n \"assignee\": \"miguel@mile.app\",\n \"capacity\": {\n \"weight\": {\n \"max\": 300,\n \"min\": 0\n },\n \"volume\": {\n \"max\": 1000,\n \"min\": 0\n }\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ],\n \"speed\": 15,\n \"fixedCost\": 0,\n \"oddEven\": \"even\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n }\n }\n ],\n \"background\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/routing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Result 01-24-2023 02:54:09\",\n \"hubId\": \"6352736c628401059b37a2e2\",\n \"hubCoordinate\": \"-6.17148,106.82649\",\n \"configuration\": {\n \"name\": \"Configuration Default\",\n \"capacityConstraint\": [\n \"weight\",\n \"width\",\n \"volume\"\n ],\n \"multitrip\": false,\n \"returnToHub\": false,\n \"clustering\": \"none\",\n \"useAllVehicle\": false,\n \"autoSpeed\": false,\n \"defaultSpeed\": 10,\n \"defaultVisitTime\": 10,\n \"autoSplit\": \"none\",\n \"autoMerge\": false,\n \"crossDockingType\": \"all\",\n \"subHubs\": [\n {\n \"id\": \"660ce14bf7613e566145fe86\",\n \"name\": \"Testing\",\n \"address\": \"Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia\",\n \"coordinate\": \"-6.84337,108.71348\"\n }\n ],\n \"multidayOption\": \"from hub\",\n \"useOddEven\": true,\n \"oddEvenTime\": [\n {\n \"startTime\": \"07:00\",\n \"endTime\": \"10:00\"\n },\n {\n \"startTime\": \"17:00\",\n \"endTime\": \"20:00\"\n }\n ]\n },\n \"routingDate\": \"2023-08-08\",\n \"resultCode\": \"Route-20230801-001\",\n \"visits\": [\n {\n \"id\": \"taskId-6311cc36db29775ad01694e6\",\n \"name\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.230815251666679,106.75684387903198\",\n \"timeWindow\": {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n },\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 100,\n \"volume\": 150\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n },\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindows\": [\n {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n }\n ],\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 2500,\n \"volume\": 6000\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n }\n ],\n \"vehicles\": [\n {\n \"id\": \"6352736c628401059b37a2e2\",\n \"name\": \"B001ACB\",\n \"assignee\": \"miguel@mile.app\",\n \"capacity\": {\n \"weight\": {\n \"max\": 300,\n \"min\": 0\n },\n \"volume\": {\n \"max\": 1000,\n \"min\": 0\n }\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ],\n \"speed\": 15,\n \"fixedCost\": 0,\n \"oddEven\": \"even\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n }\n }\n ],\n \"background\": true\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"name": "Result 01-24-2023 02:54:09",
"status": "done",
"resultCode": "Route-20230801-001",
"result": {
"routing": [
{
"vehicleId": "6352736c628401059b37a2e2",
"vehicleName": "B001ACB",
"assignee": "miguel@mile.app",
"workingTime": {
"startTime": "08:00:00",
"endTime": "17:00:00"
},
"vehicleTags": [
"Even",
"East"
],
"isOddEven": true,
"trips": [
{
"visitId": "hub-6352736c628401059b37a2e2",
"coordinate": "-6.17527,106.82581",
"weight": 0,
"volume": 0,
"isHub": true,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "08:00:00",
"etd": "08:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "task-6311cc36db29775ad01694e6",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.230815251666679,106.75684387903198",
"tags": [
"Even",
"East"
],
"allowOddEven": true,
"isHub": false,
"weight": 100,
"volume": 150,
"travelTime": 34,
"visitTime": 12,
"waitingTime": 0,
"eta": "08:34:00",
"etd": "08:46:00",
"distance": 22666,
"order": 1
}
],
"totalWeight": 0,
"vehicleMaxWeight": 300,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"totalVolume": 0,
"vehicleMaxVolume": 1000,
"vehicleMinVolume": 0,
"volumePercentage": "0%",
"fixedCost": 0,
"totalNodes": 2,
"totalVisits": 1,
"speed": 30,
"totalTravelTime": 34,
"totalDistance": 22666
}
],
"dropped": [
{
"id": "63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": "08:00:00",
"endTime": "16:00:00"
},
"visitTime": 10,
"capacity": {
"weight": 2500,
"volume": 6000
},
"tags": [
"Even",
"East"
],
"weight": 2500,
"volume": 6000,
"isHub": false,
"reason": "Dropped due to constraint"
}
],
"summary": {
"routedVisits": 1,
"droppedVisits": 1,
"totalVisits": 2,
"usedVehicles": 1,
"unusedVehicles": 0,
"totalVehicles": 1,
"totalDistance": 22666,
"totalTravelTime": 34,
"totalVisitTime": 12,
"totalWaitingTime": 0,
"totalSpentTime": 22712,
"minFinishTime": "08:46:00",
"maxFinishTime": "08:46:00",
"avgFinishTime": "08:46:00",
"avgSpeed": 30,
"capacityConstraint": [
{
"name": "weight",
"optimized": 100,
"available": 300,
"percentage": 33.3
},
{
"name": "volume",
"optimized": 150,
"available": 1000,
"percentage": 15
}
]
},
"countryCode": "IDN",
"resultCode": "Route-20230801-001"
},
"hubId": "6352736c628401059b37a2e2",
"hubCoordinate": "-6.17148,106.82649",
"configuration": {
"name": "Configuration Default",
"defaultSpeed": 10,
"defaultVisitTime": 10,
"autoSplit": "none",
"multitrip": false,
"clustering": false,
"returnToHub": false,
"useAllVehicle": false,
"autoSpeed": false,
"autoMerge": false,
"capacityConstraint": [
"weight",
"width",
"volume"
],
"crossDockingType": "all",
"subHubs": [
{
"id": "660ce14bf7613e566145fe86",
"name": "Testing",
"address": "Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia",
"coordinate": "-6.84337,108.71348"
}
]
},
"createdTime": "2023-01-24T07:54:09+00:00",
"resultTotal": {
"routing": 1,
"dropped": 1,
"total": 2
},
"organizationId": "635f6a998e47b604ed5f5e02",
"createdBy": "635f6a9a8e47b604ed5f5e08",
"updatedTime": "2023-01-24T07:54:09+00:00",
"_id": "63cf8ea11209ff54de2c15d2",
"user": {
"name": "Vasco Da Gama"
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Route optimize
curl --request POST \
--url https://apiweb.mile.app/api/v3/routing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Result 01-24-2023 02:54:09",
"hubId": "6352736c628401059b37a2e2",
"hubCoordinate": "-6.17148,106.82649",
"configuration": {
"name": "Configuration Default",
"capacityConstraint": [
"weight",
"width",
"volume"
],
"multitrip": false,
"returnToHub": false,
"clustering": "none",
"useAllVehicle": false,
"autoSpeed": false,
"defaultSpeed": 10,
"defaultVisitTime": 10,
"autoSplit": "none",
"autoMerge": false,
"crossDockingType": "all",
"subHubs": [
{
"id": "660ce14bf7613e566145fe86",
"name": "Testing",
"address": "Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia",
"coordinate": "-6.84337,108.71348"
}
],
"multidayOption": "from hub",
"useOddEven": true,
"oddEvenTime": [
{
"startTime": "07:00",
"endTime": "10:00"
},
{
"startTime": "17:00",
"endTime": "20:00"
}
]
},
"routingDate": "2023-08-08",
"resultCode": "Route-20230801-001",
"visits": [
{
"id": "taskId-6311cc36db29775ad01694e6",
"name": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.230815251666679,106.75684387903198",
"timeWindow": {
"startTime": "08:00:00",
"endTime": "16:00:00"
},
"visitTime": 10,
"capacity": {
"weight": 100,
"volume": 150
},
"tags": [
"Even",
"East"
]
},
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindows": [
{
"startTime": "08:00:00",
"endTime": "16:00:00"
}
],
"visitTime": 10,
"capacity": {
"weight": 2500,
"volume": 6000
},
"tags": [
"Even",
"East"
]
}
],
"vehicles": [
{
"id": "6352736c628401059b37a2e2",
"name": "B001ACB",
"assignee": "miguel@mile.app",
"capacity": {
"weight": {
"max": 300,
"min": 0
},
"volume": {
"max": 1000,
"min": 0
}
},
"tags": [
"Even",
"East"
],
"speed": 15,
"fixedCost": 0,
"oddEven": "even",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
}
}
],
"background": true
}
'import requests
url = "https://apiweb.mile.app/api/v3/routing"
payload = {
"name": "Result 01-24-2023 02:54:09",
"hubId": "6352736c628401059b37a2e2",
"hubCoordinate": "-6.17148,106.82649",
"configuration": {
"name": "Configuration Default",
"capacityConstraint": ["weight", "width", "volume"],
"multitrip": False,
"returnToHub": False,
"clustering": "none",
"useAllVehicle": False,
"autoSpeed": False,
"defaultSpeed": 10,
"defaultVisitTime": 10,
"autoSplit": "none",
"autoMerge": False,
"crossDockingType": "all",
"subHubs": [
{
"id": "660ce14bf7613e566145fe86",
"name": "Testing",
"address": "Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia",
"coordinate": "-6.84337,108.71348"
}
],
"multidayOption": "from hub",
"useOddEven": True,
"oddEvenTime": [
{
"startTime": "07:00",
"endTime": "10:00"
},
{
"startTime": "17:00",
"endTime": "20:00"
}
]
},
"routingDate": "2023-08-08",
"resultCode": "Route-20230801-001",
"visits": [
{
"id": "taskId-6311cc36db29775ad01694e6",
"name": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.230815251666679,106.75684387903198",
"timeWindow": {
"startTime": "08:00:00",
"endTime": "16:00:00"
},
"visitTime": 10,
"capacity": {
"weight": 100,
"volume": 150
},
"tags": ["Even", "East"]
},
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindows": [
{
"startTime": "08:00:00",
"endTime": "16:00:00"
}
],
"visitTime": 10,
"capacity": {
"weight": 2500,
"volume": 6000
},
"tags": ["Even", "East"]
}
],
"vehicles": [
{
"id": "6352736c628401059b37a2e2",
"name": "B001ACB",
"assignee": "miguel@mile.app",
"capacity": {
"weight": {
"max": 300,
"min": 0
},
"volume": {
"max": 1000,
"min": 0
}
},
"tags": ["Even", "East"],
"speed": 15,
"fixedCost": 0,
"oddEven": "even",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
}
}
],
"background": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Result 01-24-2023 02:54:09',
hubId: '6352736c628401059b37a2e2',
hubCoordinate: '-6.17148,106.82649',
configuration: {
name: 'Configuration Default',
capacityConstraint: ['weight', 'width', 'volume'],
multitrip: false,
returnToHub: false,
clustering: 'none',
useAllVehicle: false,
autoSpeed: false,
defaultSpeed: 10,
defaultVisitTime: 10,
autoSplit: 'none',
autoMerge: false,
crossDockingType: 'all',
subHubs: [
{
id: '660ce14bf7613e566145fe86',
name: 'Testing',
address: 'Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia',
coordinate: '-6.84337,108.71348'
}
],
multidayOption: 'from hub',
useOddEven: true,
oddEvenTime: [{startTime: '07:00', endTime: '10:00'}, {startTime: '17:00', endTime: '20:00'}]
},
routingDate: '2023-08-08',
resultCode: 'Route-20230801-001',
visits: [
{
id: 'taskId-6311cc36db29775ad01694e6',
name: 'Visit 1',
address: 'Neo Soho, Jakarta Barat',
coordinate: '-6.230815251666679,106.75684387903198',
timeWindow: {startTime: '08:00:00', endTime: '16:00:00'},
visitTime: 10,
capacity: {weight: 100, volume: 150},
tags: ['Even', 'East']
},
{
id: 'taskId-63970a49cc6ae973f90929e2',
name: 'Visit 2',
address: 'Gambir Jakarta',
coordinate: '-6.17148,106.82649',
timeWindows: [{startTime: '08:00:00', endTime: '16:00:00'}],
visitTime: 10,
capacity: {weight: 2500, volume: 6000},
tags: ['Even', 'East']
}
],
vehicles: [
{
id: '6352736c628401059b37a2e2',
name: 'B001ACB',
assignee: 'miguel@mile.app',
capacity: {weight: {max: 300, min: 0}, volume: {max: 1000, min: 0}},
tags: ['Even', 'East'],
speed: 15,
fixedCost: 0,
oddEven: 'even',
workingTime: {startTime: '08:00', endTime: '17:00'}
}
],
background: true
})
};
fetch('https://apiweb.mile.app/api/v3/routing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/routing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Result 01-24-2023 02:54:09',
'hubId' => '6352736c628401059b37a2e2',
'hubCoordinate' => '-6.17148,106.82649',
'configuration' => [
'name' => 'Configuration Default',
'capacityConstraint' => [
'weight',
'width',
'volume'
],
'multitrip' => false,
'returnToHub' => false,
'clustering' => 'none',
'useAllVehicle' => false,
'autoSpeed' => false,
'defaultSpeed' => 10,
'defaultVisitTime' => 10,
'autoSplit' => 'none',
'autoMerge' => false,
'crossDockingType' => 'all',
'subHubs' => [
[
'id' => '660ce14bf7613e566145fe86',
'name' => 'Testing',
'address' => 'Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia',
'coordinate' => '-6.84337,108.71348'
]
],
'multidayOption' => 'from hub',
'useOddEven' => true,
'oddEvenTime' => [
[
'startTime' => '07:00',
'endTime' => '10:00'
],
[
'startTime' => '17:00',
'endTime' => '20:00'
]
]
],
'routingDate' => '2023-08-08',
'resultCode' => 'Route-20230801-001',
'visits' => [
[
'id' => 'taskId-6311cc36db29775ad01694e6',
'name' => 'Visit 1',
'address' => 'Neo Soho, Jakarta Barat',
'coordinate' => '-6.230815251666679,106.75684387903198',
'timeWindow' => [
'startTime' => '08:00:00',
'endTime' => '16:00:00'
],
'visitTime' => 10,
'capacity' => [
'weight' => 100,
'volume' => 150
],
'tags' => [
'Even',
'East'
]
],
[
'id' => 'taskId-63970a49cc6ae973f90929e2',
'name' => 'Visit 2',
'address' => 'Gambir Jakarta',
'coordinate' => '-6.17148,106.82649',
'timeWindows' => [
[
'startTime' => '08:00:00',
'endTime' => '16:00:00'
]
],
'visitTime' => 10,
'capacity' => [
'weight' => 2500,
'volume' => 6000
],
'tags' => [
'Even',
'East'
]
]
],
'vehicles' => [
[
'id' => '6352736c628401059b37a2e2',
'name' => 'B001ACB',
'assignee' => 'miguel@mile.app',
'capacity' => [
'weight' => [
'max' => 300,
'min' => 0
],
'volume' => [
'max' => 1000,
'min' => 0
]
],
'tags' => [
'Even',
'East'
],
'speed' => 15,
'fixedCost' => 0,
'oddEven' => 'even',
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00'
]
]
],
'background' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/routing"
payload := strings.NewReader("{\n \"name\": \"Result 01-24-2023 02:54:09\",\n \"hubId\": \"6352736c628401059b37a2e2\",\n \"hubCoordinate\": \"-6.17148,106.82649\",\n \"configuration\": {\n \"name\": \"Configuration Default\",\n \"capacityConstraint\": [\n \"weight\",\n \"width\",\n \"volume\"\n ],\n \"multitrip\": false,\n \"returnToHub\": false,\n \"clustering\": \"none\",\n \"useAllVehicle\": false,\n \"autoSpeed\": false,\n \"defaultSpeed\": 10,\n \"defaultVisitTime\": 10,\n \"autoSplit\": \"none\",\n \"autoMerge\": false,\n \"crossDockingType\": \"all\",\n \"subHubs\": [\n {\n \"id\": \"660ce14bf7613e566145fe86\",\n \"name\": \"Testing\",\n \"address\": \"Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia\",\n \"coordinate\": \"-6.84337,108.71348\"\n }\n ],\n \"multidayOption\": \"from hub\",\n \"useOddEven\": true,\n \"oddEvenTime\": [\n {\n \"startTime\": \"07:00\",\n \"endTime\": \"10:00\"\n },\n {\n \"startTime\": \"17:00\",\n \"endTime\": \"20:00\"\n }\n ]\n },\n \"routingDate\": \"2023-08-08\",\n \"resultCode\": \"Route-20230801-001\",\n \"visits\": [\n {\n \"id\": \"taskId-6311cc36db29775ad01694e6\",\n \"name\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.230815251666679,106.75684387903198\",\n \"timeWindow\": {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n },\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 100,\n \"volume\": 150\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n },\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindows\": [\n {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n }\n ],\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 2500,\n \"volume\": 6000\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n }\n ],\n \"vehicles\": [\n {\n \"id\": \"6352736c628401059b37a2e2\",\n \"name\": \"B001ACB\",\n \"assignee\": \"miguel@mile.app\",\n \"capacity\": {\n \"weight\": {\n \"max\": 300,\n \"min\": 0\n },\n \"volume\": {\n \"max\": 1000,\n \"min\": 0\n }\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ],\n \"speed\": 15,\n \"fixedCost\": 0,\n \"oddEven\": \"even\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n }\n }\n ],\n \"background\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/routing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Result 01-24-2023 02:54:09\",\n \"hubId\": \"6352736c628401059b37a2e2\",\n \"hubCoordinate\": \"-6.17148,106.82649\",\n \"configuration\": {\n \"name\": \"Configuration Default\",\n \"capacityConstraint\": [\n \"weight\",\n \"width\",\n \"volume\"\n ],\n \"multitrip\": false,\n \"returnToHub\": false,\n \"clustering\": \"none\",\n \"useAllVehicle\": false,\n \"autoSpeed\": false,\n \"defaultSpeed\": 10,\n \"defaultVisitTime\": 10,\n \"autoSplit\": \"none\",\n \"autoMerge\": false,\n \"crossDockingType\": \"all\",\n \"subHubs\": [\n {\n \"id\": \"660ce14bf7613e566145fe86\",\n \"name\": \"Testing\",\n \"address\": \"Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia\",\n \"coordinate\": \"-6.84337,108.71348\"\n }\n ],\n \"multidayOption\": \"from hub\",\n \"useOddEven\": true,\n \"oddEvenTime\": [\n {\n \"startTime\": \"07:00\",\n \"endTime\": \"10:00\"\n },\n {\n \"startTime\": \"17:00\",\n \"endTime\": \"20:00\"\n }\n ]\n },\n \"routingDate\": \"2023-08-08\",\n \"resultCode\": \"Route-20230801-001\",\n \"visits\": [\n {\n \"id\": \"taskId-6311cc36db29775ad01694e6\",\n \"name\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.230815251666679,106.75684387903198\",\n \"timeWindow\": {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n },\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 100,\n \"volume\": 150\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n },\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindows\": [\n {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n }\n ],\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 2500,\n \"volume\": 6000\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n }\n ],\n \"vehicles\": [\n {\n \"id\": \"6352736c628401059b37a2e2\",\n \"name\": \"B001ACB\",\n \"assignee\": \"miguel@mile.app\",\n \"capacity\": {\n \"weight\": {\n \"max\": 300,\n \"min\": 0\n },\n \"volume\": {\n \"max\": 1000,\n \"min\": 0\n }\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ],\n \"speed\": 15,\n \"fixedCost\": 0,\n \"oddEven\": \"even\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n }\n }\n ],\n \"background\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/routing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Result 01-24-2023 02:54:09\",\n \"hubId\": \"6352736c628401059b37a2e2\",\n \"hubCoordinate\": \"-6.17148,106.82649\",\n \"configuration\": {\n \"name\": \"Configuration Default\",\n \"capacityConstraint\": [\n \"weight\",\n \"width\",\n \"volume\"\n ],\n \"multitrip\": false,\n \"returnToHub\": false,\n \"clustering\": \"none\",\n \"useAllVehicle\": false,\n \"autoSpeed\": false,\n \"defaultSpeed\": 10,\n \"defaultVisitTime\": 10,\n \"autoSplit\": \"none\",\n \"autoMerge\": false,\n \"crossDockingType\": \"all\",\n \"subHubs\": [\n {\n \"id\": \"660ce14bf7613e566145fe86\",\n \"name\": \"Testing\",\n \"address\": \"Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia\",\n \"coordinate\": \"-6.84337,108.71348\"\n }\n ],\n \"multidayOption\": \"from hub\",\n \"useOddEven\": true,\n \"oddEvenTime\": [\n {\n \"startTime\": \"07:00\",\n \"endTime\": \"10:00\"\n },\n {\n \"startTime\": \"17:00\",\n \"endTime\": \"20:00\"\n }\n ]\n },\n \"routingDate\": \"2023-08-08\",\n \"resultCode\": \"Route-20230801-001\",\n \"visits\": [\n {\n \"id\": \"taskId-6311cc36db29775ad01694e6\",\n \"name\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.230815251666679,106.75684387903198\",\n \"timeWindow\": {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n },\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 100,\n \"volume\": 150\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n },\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindows\": [\n {\n \"startTime\": \"08:00:00\",\n \"endTime\": \"16:00:00\"\n }\n ],\n \"visitTime\": 10,\n \"capacity\": {\n \"weight\": 2500,\n \"volume\": 6000\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ]\n }\n ],\n \"vehicles\": [\n {\n \"id\": \"6352736c628401059b37a2e2\",\n \"name\": \"B001ACB\",\n \"assignee\": \"miguel@mile.app\",\n \"capacity\": {\n \"weight\": {\n \"max\": 300,\n \"min\": 0\n },\n \"volume\": {\n \"max\": 1000,\n \"min\": 0\n }\n },\n \"tags\": [\n \"Even\",\n \"East\"\n ],\n \"speed\": 15,\n \"fixedCost\": 0,\n \"oddEven\": \"even\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n }\n }\n ],\n \"background\": true\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"name": "Result 01-24-2023 02:54:09",
"status": "done",
"resultCode": "Route-20230801-001",
"result": {
"routing": [
{
"vehicleId": "6352736c628401059b37a2e2",
"vehicleName": "B001ACB",
"assignee": "miguel@mile.app",
"workingTime": {
"startTime": "08:00:00",
"endTime": "17:00:00"
},
"vehicleTags": [
"Even",
"East"
],
"isOddEven": true,
"trips": [
{
"visitId": "hub-6352736c628401059b37a2e2",
"coordinate": "-6.17527,106.82581",
"weight": 0,
"volume": 0,
"isHub": true,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "08:00:00",
"etd": "08:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "task-6311cc36db29775ad01694e6",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.230815251666679,106.75684387903198",
"tags": [
"Even",
"East"
],
"allowOddEven": true,
"isHub": false,
"weight": 100,
"volume": 150,
"travelTime": 34,
"visitTime": 12,
"waitingTime": 0,
"eta": "08:34:00",
"etd": "08:46:00",
"distance": 22666,
"order": 1
}
],
"totalWeight": 0,
"vehicleMaxWeight": 300,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"totalVolume": 0,
"vehicleMaxVolume": 1000,
"vehicleMinVolume": 0,
"volumePercentage": "0%",
"fixedCost": 0,
"totalNodes": 2,
"totalVisits": 1,
"speed": 30,
"totalTravelTime": 34,
"totalDistance": 22666
}
],
"dropped": [
{
"id": "63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": "08:00:00",
"endTime": "16:00:00"
},
"visitTime": 10,
"capacity": {
"weight": 2500,
"volume": 6000
},
"tags": [
"Even",
"East"
],
"weight": 2500,
"volume": 6000,
"isHub": false,
"reason": "Dropped due to constraint"
}
],
"summary": {
"routedVisits": 1,
"droppedVisits": 1,
"totalVisits": 2,
"usedVehicles": 1,
"unusedVehicles": 0,
"totalVehicles": 1,
"totalDistance": 22666,
"totalTravelTime": 34,
"totalVisitTime": 12,
"totalWaitingTime": 0,
"totalSpentTime": 22712,
"minFinishTime": "08:46:00",
"maxFinishTime": "08:46:00",
"avgFinishTime": "08:46:00",
"avgSpeed": 30,
"capacityConstraint": [
{
"name": "weight",
"optimized": 100,
"available": 300,
"percentage": 33.3
},
{
"name": "volume",
"optimized": 150,
"available": 1000,
"percentage": 15
}
]
},
"countryCode": "IDN",
"resultCode": "Route-20230801-001"
},
"hubId": "6352736c628401059b37a2e2",
"hubCoordinate": "-6.17148,106.82649",
"configuration": {
"name": "Configuration Default",
"defaultSpeed": 10,
"defaultVisitTime": 10,
"autoSplit": "none",
"multitrip": false,
"clustering": false,
"returnToHub": false,
"useAllVehicle": false,
"autoSpeed": false,
"autoMerge": false,
"capacityConstraint": [
"weight",
"width",
"volume"
],
"crossDockingType": "all",
"subHubs": [
{
"id": "660ce14bf7613e566145fe86",
"name": "Testing",
"address": "Jalan Kalimaro, Cirebon Kabupaten 45694, Indonesia",
"coordinate": "-6.84337,108.71348"
}
]
},
"createdTime": "2023-01-24T07:54:09+00:00",
"resultTotal": {
"routing": 1,
"dropped": 1,
"total": 2
},
"organizationId": "635f6a998e47b604ed5f5e02",
"createdBy": "635f6a9a8e47b604ed5f5e08",
"updatedTime": "2023-01-24T07:54:09+00:00",
"_id": "63cf8ea11209ff54de2c15d2",
"user": {
"name": "Vasco Da Gama"
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Authorizations
Use a valid Bearer token to authenticate.
Body
Fundamental entity within an organization, serving as the central point for managing various operational components. Use GET /hubs endpoint to get the list of Hub IDs. Example: 634e98498ce07d29474a7e29
List of visits used for routing. Each visit represents a destination to be included in the optimized route.
Show child attributes
Show child attributes
List of vehicles used for routing. Each vehicle represents a specific vehicle available for the route optimization process.
Show child attributes
Show child attributes
The desired name for the routing result. Users have the flexibility to define a custom name for the result. Default: Routing m-d H:i.
Example: Routing 01-03 10:53
Coordinate of the hub. The hub coordinates represent the geographic coordinates (latitude and longitude) of the central location or starting point for the route optimization process. Example: -6.230815251666679,106.75684387903198
Configuration settings for route optimization. The default values for these configuration settings are taken from the menu route configuration at web.mile.app.
Show child attributes
Show child attributes
This key allows users to assign unique values for result optimization data as per their requirements. If not provided, the response will automatically generate a unique resultCode. Additionally, the resultCode key can be used as a filter to categorize API responses efficiently. Default: Unique Timestamp Example: Route-20230801-001
Determines the routing date to comply with odd-even traffic regulations applicable on that day. This date is used to check whether vehicles are allowed to enter odd-even restricted areas based on their license plate numbers. Format: Y-m-d Example: 2023-08-08
When the background parameter is set to true , the routing will be processed in the background. In this mode, the API call will return quickly with a response indicating that the routing request has been received and is being processed asynchronously in the background. When the background parameter is set to false (default), the routing will be processed directly via the API, and the response will be provided immediately. This means that the API call will wait for the route optimization process to complete before returning the results to the user.
Default: false