curl --request PUT \
--url https://apiweb.mile.app/api/v3/result/{resultId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"result": {
"routing": [
{
"vehicleId": "63da418fc05c0d0269071cf3",
"vehicleName": "B001ACB 1",
"assignee": "roberto@mile.app",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
},
"vehicleTags": [
"West",
"Odd"
],
"trips": [
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "8:00:00",
"etd": "8:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "taskId-63994a54e1528d445641d9a2",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.261532638313604,106.80685970157342",
"isHub": false,
"tags": [
"West",
"Odd"
],
"timeWindow": {
"startTime": null,
"endTime": null
},
"weight": 0,
"travelTime": 31,
"visitTime": 17,
"waitingTime": 0,
"eta": "8:30:46",
"etd": "8:47:46",
"distance": 12817,
"order": 1
},
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 3,
"visitTime": 0,
"waitingTime": 0,
"eta": "9:41:12",
"etd": "9:41:12",
"distance": 974,
"order": 3
}
],
"totalWeight": 0,
"vehicleMaxWeight": 100,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"speed": 25,
"totalTravelTime": 69,
"totalDistance": 27996,
"totalVisitTime": 34,
"totalWaitingTime": 0,
"totalSpentTime": 103
}
],
"dropped": [
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": null,
"endTime": null
},
"visitTime": "20",
"capacity": {
"weight": 20.12345
},
"tags": [
"63da418fc05c0d0269071cf2"
],
"assignedVehicleId": "63da418fc05c0d0269071cf2",
"isHub": false,
"reason": "No vehicle with matching tags",
"visitId": "taskId-63970a49cc6ae973f90929e2",
"visitName": "Visit 2"
}
]
}
}
'import requests
url = "https://apiweb.mile.app/api/v3/result/{resultId}"
payload = { "result": {
"routing": [
{
"vehicleId": "63da418fc05c0d0269071cf3",
"vehicleName": "B001ACB 1",
"assignee": "roberto@mile.app",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
},
"vehicleTags": ["West", "Odd"],
"trips": [
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": True,
"weight": 0,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "8:00:00",
"etd": "8:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "taskId-63994a54e1528d445641d9a2",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.261532638313604,106.80685970157342",
"isHub": False,
"tags": ["West", "Odd"],
"timeWindow": {
"startTime": None,
"endTime": None
},
"weight": 0,
"travelTime": 31,
"visitTime": 17,
"waitingTime": 0,
"eta": "8:30:46",
"etd": "8:47:46",
"distance": 12817,
"order": 1
},
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": True,
"weight": 0,
"travelTime": 3,
"visitTime": 0,
"waitingTime": 0,
"eta": "9:41:12",
"etd": "9:41:12",
"distance": 974,
"order": 3
}
],
"totalWeight": 0,
"vehicleMaxWeight": 100,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"speed": 25,
"totalTravelTime": 69,
"totalDistance": 27996,
"totalVisitTime": 34,
"totalWaitingTime": 0,
"totalSpentTime": 103
}
],
"dropped": [
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": None,
"endTime": None
},
"visitTime": "20",
"capacity": { "weight": 20.12345 },
"tags": ["63da418fc05c0d0269071cf2"],
"assignedVehicleId": "63da418fc05c0d0269071cf2",
"isHub": False,
"reason": "No vehicle with matching tags",
"visitId": "taskId-63970a49cc6ae973f90929e2",
"visitName": "Visit 2"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
result: {
routing: [
{
vehicleId: '63da418fc05c0d0269071cf3',
vehicleName: 'B001ACB 1',
assignee: 'roberto@mile.app',
workingTime: {startTime: '08:00', endTime: '17:00'},
vehicleTags: ['West', 'Odd'],
trips: [
{
visitId: 'hub-635f6ad98e47b604ed5f5e09',
coordinate: '-6.17148,106.82649',
isHub: true,
weight: 0,
travelTime: 0,
visitTime: 0,
waitingTime: 0,
eta: '8:00:00',
etd: '8:00:00',
distance: 0,
order: 0
},
{
visitId: 'taskId-63994a54e1528d445641d9a2',
visitName: 'Visit 1',
address: 'Neo Soho, Jakarta Barat',
coordinate: '-6.261532638313604,106.80685970157342',
isHub: false,
tags: ['West', 'Odd'],
timeWindow: {startTime: null, endTime: null},
weight: 0,
travelTime: 31,
visitTime: 17,
waitingTime: 0,
eta: '8:30:46',
etd: '8:47:46',
distance: 12817,
order: 1
},
{
visitId: 'hub-635f6ad98e47b604ed5f5e09',
coordinate: '-6.17148,106.82649',
isHub: true,
weight: 0,
travelTime: 3,
visitTime: 0,
waitingTime: 0,
eta: '9:41:12',
etd: '9:41:12',
distance: 974,
order: 3
}
],
totalWeight: 0,
vehicleMaxWeight: 100,
vehicleMinWeight: 0,
weightPercentage: '0%',
speed: 25,
totalTravelTime: 69,
totalDistance: 27996,
totalVisitTime: 34,
totalWaitingTime: 0,
totalSpentTime: 103
}
],
dropped: [
{
id: 'taskId-63970a49cc6ae973f90929e2',
name: 'Visit 2',
address: 'Gambir Jakarta',
coordinate: '-6.17148,106.82649',
timeWindow: {startTime: null, endTime: null},
visitTime: '20',
capacity: {weight: 20.12345},
tags: ['63da418fc05c0d0269071cf2'],
assignedVehicleId: '63da418fc05c0d0269071cf2',
isHub: false,
reason: 'No vehicle with matching tags',
visitId: 'taskId-63970a49cc6ae973f90929e2',
visitName: 'Visit 2'
}
]
}
})
};
fetch('https://apiweb.mile.app/api/v3/result/{resultId}', 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/result/{resultId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'result' => [
'routing' => [
[
'vehicleId' => '63da418fc05c0d0269071cf3',
'vehicleName' => 'B001ACB 1',
'assignee' => 'roberto@mile.app',
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00'
],
'vehicleTags' => [
'West',
'Odd'
],
'trips' => [
[
'visitId' => 'hub-635f6ad98e47b604ed5f5e09',
'coordinate' => '-6.17148,106.82649',
'isHub' => true,
'weight' => 0,
'travelTime' => 0,
'visitTime' => 0,
'waitingTime' => 0,
'eta' => '8:00:00',
'etd' => '8:00:00',
'distance' => 0,
'order' => 0
],
[
'visitId' => 'taskId-63994a54e1528d445641d9a2',
'visitName' => 'Visit 1',
'address' => 'Neo Soho, Jakarta Barat',
'coordinate' => '-6.261532638313604,106.80685970157342',
'isHub' => false,
'tags' => [
'West',
'Odd'
],
'timeWindow' => [
'startTime' => null,
'endTime' => null
],
'weight' => 0,
'travelTime' => 31,
'visitTime' => 17,
'waitingTime' => 0,
'eta' => '8:30:46',
'etd' => '8:47:46',
'distance' => 12817,
'order' => 1
],
[
'visitId' => 'hub-635f6ad98e47b604ed5f5e09',
'coordinate' => '-6.17148,106.82649',
'isHub' => true,
'weight' => 0,
'travelTime' => 3,
'visitTime' => 0,
'waitingTime' => 0,
'eta' => '9:41:12',
'etd' => '9:41:12',
'distance' => 974,
'order' => 3
]
],
'totalWeight' => 0,
'vehicleMaxWeight' => 100,
'vehicleMinWeight' => 0,
'weightPercentage' => '0%',
'speed' => 25,
'totalTravelTime' => 69,
'totalDistance' => 27996,
'totalVisitTime' => 34,
'totalWaitingTime' => 0,
'totalSpentTime' => 103
]
],
'dropped' => [
[
'id' => 'taskId-63970a49cc6ae973f90929e2',
'name' => 'Visit 2',
'address' => 'Gambir Jakarta',
'coordinate' => '-6.17148,106.82649',
'timeWindow' => [
'startTime' => null,
'endTime' => null
],
'visitTime' => '20',
'capacity' => [
'weight' => 20.12345
],
'tags' => [
'63da418fc05c0d0269071cf2'
],
'assignedVehicleId' => '63da418fc05c0d0269071cf2',
'isHub' => false,
'reason' => 'No vehicle with matching tags',
'visitId' => 'taskId-63970a49cc6ae973f90929e2',
'visitName' => 'Visit 2'
]
]
]
]),
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/result/{resultId}"
payload := strings.NewReader("{\n \"result\": {\n \"routing\": [\n {\n \"vehicleId\": \"63da418fc05c0d0269071cf3\",\n \"vehicleName\": \"B001ACB 1\",\n \"assignee\": \"roberto@mile.app\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n },\n \"vehicleTags\": [\n \"West\",\n \"Odd\"\n ],\n \"trips\": [\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 0,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"8:00:00\",\n \"etd\": \"8:00:00\",\n \"distance\": 0,\n \"order\": 0\n },\n {\n \"visitId\": \"taskId-63994a54e1528d445641d9a2\",\n \"visitName\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.261532638313604,106.80685970157342\",\n \"isHub\": false,\n \"tags\": [\n \"West\",\n \"Odd\"\n ],\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"weight\": 0,\n \"travelTime\": 31,\n \"visitTime\": 17,\n \"waitingTime\": 0,\n \"eta\": \"8:30:46\",\n \"etd\": \"8:47:46\",\n \"distance\": 12817,\n \"order\": 1\n },\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 3,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"9:41:12\",\n \"etd\": \"9:41:12\",\n \"distance\": 974,\n \"order\": 3\n }\n ],\n \"totalWeight\": 0,\n \"vehicleMaxWeight\": 100,\n \"vehicleMinWeight\": 0,\n \"weightPercentage\": \"0%\",\n \"speed\": 25,\n \"totalTravelTime\": 69,\n \"totalDistance\": 27996,\n \"totalVisitTime\": 34,\n \"totalWaitingTime\": 0,\n \"totalSpentTime\": 103\n }\n ],\n \"dropped\": [\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"visitTime\": \"20\",\n \"capacity\": {\n \"weight\": 20.12345\n },\n \"tags\": [\n \"63da418fc05c0d0269071cf2\"\n ],\n \"assignedVehicleId\": \"63da418fc05c0d0269071cf2\",\n \"isHub\": false,\n \"reason\": \"No vehicle with matching tags\",\n \"visitId\": \"taskId-63970a49cc6ae973f90929e2\",\n \"visitName\": \"Visit 2\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://apiweb.mile.app/api/v3/result/{resultId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"result\": {\n \"routing\": [\n {\n \"vehicleId\": \"63da418fc05c0d0269071cf3\",\n \"vehicleName\": \"B001ACB 1\",\n \"assignee\": \"roberto@mile.app\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n },\n \"vehicleTags\": [\n \"West\",\n \"Odd\"\n ],\n \"trips\": [\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 0,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"8:00:00\",\n \"etd\": \"8:00:00\",\n \"distance\": 0,\n \"order\": 0\n },\n {\n \"visitId\": \"taskId-63994a54e1528d445641d9a2\",\n \"visitName\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.261532638313604,106.80685970157342\",\n \"isHub\": false,\n \"tags\": [\n \"West\",\n \"Odd\"\n ],\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"weight\": 0,\n \"travelTime\": 31,\n \"visitTime\": 17,\n \"waitingTime\": 0,\n \"eta\": \"8:30:46\",\n \"etd\": \"8:47:46\",\n \"distance\": 12817,\n \"order\": 1\n },\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 3,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"9:41:12\",\n \"etd\": \"9:41:12\",\n \"distance\": 974,\n \"order\": 3\n }\n ],\n \"totalWeight\": 0,\n \"vehicleMaxWeight\": 100,\n \"vehicleMinWeight\": 0,\n \"weightPercentage\": \"0%\",\n \"speed\": 25,\n \"totalTravelTime\": 69,\n \"totalDistance\": 27996,\n \"totalVisitTime\": 34,\n \"totalWaitingTime\": 0,\n \"totalSpentTime\": 103\n }\n ],\n \"dropped\": [\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"visitTime\": \"20\",\n \"capacity\": {\n \"weight\": 20.12345\n },\n \"tags\": [\n \"63da418fc05c0d0269071cf2\"\n ],\n \"assignedVehicleId\": \"63da418fc05c0d0269071cf2\",\n \"isHub\": false,\n \"reason\": \"No vehicle with matching tags\",\n \"visitId\": \"taskId-63970a49cc6ae973f90929e2\",\n \"visitName\": \"Visit 2\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/result/{resultId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"result\": {\n \"routing\": [\n {\n \"vehicleId\": \"63da418fc05c0d0269071cf3\",\n \"vehicleName\": \"B001ACB 1\",\n \"assignee\": \"roberto@mile.app\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n },\n \"vehicleTags\": [\n \"West\",\n \"Odd\"\n ],\n \"trips\": [\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 0,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"8:00:00\",\n \"etd\": \"8:00:00\",\n \"distance\": 0,\n \"order\": 0\n },\n {\n \"visitId\": \"taskId-63994a54e1528d445641d9a2\",\n \"visitName\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.261532638313604,106.80685970157342\",\n \"isHub\": false,\n \"tags\": [\n \"West\",\n \"Odd\"\n ],\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"weight\": 0,\n \"travelTime\": 31,\n \"visitTime\": 17,\n \"waitingTime\": 0,\n \"eta\": \"8:30:46\",\n \"etd\": \"8:47:46\",\n \"distance\": 12817,\n \"order\": 1\n },\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 3,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"9:41:12\",\n \"etd\": \"9:41:12\",\n \"distance\": 974,\n \"order\": 3\n }\n ],\n \"totalWeight\": 0,\n \"vehicleMaxWeight\": 100,\n \"vehicleMinWeight\": 0,\n \"weightPercentage\": \"0%\",\n \"speed\": 25,\n \"totalTravelTime\": 69,\n \"totalDistance\": 27996,\n \"totalVisitTime\": 34,\n \"totalWaitingTime\": 0,\n \"totalSpentTime\": 103\n }\n ],\n \"dropped\": [\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"visitTime\": \"20\",\n \"capacity\": {\n \"weight\": 20.12345\n },\n \"tags\": [\n \"63da418fc05c0d0269071cf2\"\n ],\n \"assignedVehicleId\": \"63da418fc05c0d0269071cf2\",\n \"isHub\": false,\n \"reason\": \"No vehicle with matching tags\",\n \"visitId\": \"taskId-63970a49cc6ae973f90929e2\",\n \"visitName\": \"Visit 2\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"property": {
"_id": "6352736c628401059b37a2e2",
"name": "Result Today",
"result": {
"resultCode": "Route-20230801-001",
"routing": [
{
"vehicleId": "63da418fc05c0d0269071cf3",
"vehicleName": "B001ACB 1",
"assignee": "roberto@mile.app",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
},
"vehicleTags": [
"West",
"Odd"
],
"isOddEven": true,
"oddEven": "even",
"trips": [
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "8:00:00",
"etd": "8:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "taskId-63994a54e1528d445641d9a2",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.261532638313604,106.80685970157342",
"isHub": false,
"tags": [
"West",
"Odd"
],
"timeWindow": {
"startTime": null,
"endTime": null
},
"weight": 0,
"travelTime": 31,
"visitTime": 17,
"waitingTime": 0,
"eta": "8:30:46",
"etd": "8:47:46",
"distance": 12817,
"order": 1,
"allowOddEven": true
},
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 3,
"visitTime": 0,
"waitingTime": 0,
"eta": "9:41:12",
"etd": "9:41:12",
"distance": 974,
"order": 3
}
],
"totalWeight": 0,
"vehicleMaxWeight": 100,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"fixedCost": 0,
"totalNodes": 3,
"totalVisits": 1,
"speed": 25,
"totalTravelTime": 69,
"totalDistance": 27996,
"totalVisitTime": 34,
"totalWaitingTime": 0,
"totalSpentTime": 103
}
],
"dropped": [
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": null,
"endTime": null
},
"visitTime": "20",
"capacity": {
"weight": 20.12345
},
"tags": [
"63da418fc05c0d0269071cf2"
],
"assignedVehicleId": "63da418fc05c0d0269071cf2",
"isHub": false,
"reason": "No vehicle with matching tags",
"visitId": "taskId-63970a49cc6ae973f90929e2",
"visitName": "Visit 2"
}
],
"summary": {
"routedVisits": 1,
"droppedVisits": 1,
"totalVisits": 2,
"usedVehicles": 1,
"unusedVehicles": 0,
"totalVehicles": 1,
"totalDistance": 22666,
"totalTravelTime": 34,
"totalVisitTime": 12,
"totalWaitingTime": 0,
"totalSpentTime": 22712,
"minFinishTime": "09:41:12",
"maxFinishTime": "09:41:12",
"avgFinishTime": "09:41:12",
"avgSpeed": 30,
"capacityConstraint": [
{
"name": "weight",
"optimized": 100,
"available": 300,
"percentage": 33.3
}
]
}
},
"hubId": "635f6ad98e47b604ed5f5e09",
"hubCoordinate": "-6.17148,106.82649",
"configurationId": null,
"configuration": {
"defaultVisitTime": 10,
"defaultSpeed": 15,
"multitrip": false,
"returnToHub": true,
"useAllVehicle": true,
"clustering": false,
"capacityConstraint": [
"weight"
],
"name": "Configuration Default",
"autoSpeed": false,
"tripsPerVehicle": -1,
"useOddEven": true,
"oddEvenTime": [
{
"startTime": "07:00",
"endTime": "10:00"
},
{
"startTime": "17:00",
"endTime": "20:00"
}
]
},
"routingDate": "2023-08-08",
"createdTime": "2023-02-06T01:18:36+00:00",
"resultTotal": {
"routing": 1,
"dropped": 1,
"total": 2
},
"organizationId": "635f6a998e47b604ed5f5e02",
"createdBy": "635f6a9a8e47b604ed5f5e08",
"updatedTime": "2023-02-06T06:59:03+00:00",
"user": {
"name": "Marshall Teach"
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Update routing result by ID
The API PUT request for Routing Result by ID serves to update the existing routing result using the provided payload data. This action involves a comprehensive replacement of all present data within the routing result with the new information supplied in the payload. It’s important to exercise caution when utilizing this request, as improper handling could lead to unintended data loss.
In addition to the primary effects, the successful execution of the PUT request triggers an automatic recalculation of the summary associated with the modified routing result. This step ensures that the summary remains synchronized with the updated data, providing an accurate representation of the routing result’s current state.
curl --request PUT \
--url https://apiweb.mile.app/api/v3/result/{resultId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"result": {
"routing": [
{
"vehicleId": "63da418fc05c0d0269071cf3",
"vehicleName": "B001ACB 1",
"assignee": "roberto@mile.app",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
},
"vehicleTags": [
"West",
"Odd"
],
"trips": [
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "8:00:00",
"etd": "8:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "taskId-63994a54e1528d445641d9a2",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.261532638313604,106.80685970157342",
"isHub": false,
"tags": [
"West",
"Odd"
],
"timeWindow": {
"startTime": null,
"endTime": null
},
"weight": 0,
"travelTime": 31,
"visitTime": 17,
"waitingTime": 0,
"eta": "8:30:46",
"etd": "8:47:46",
"distance": 12817,
"order": 1
},
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 3,
"visitTime": 0,
"waitingTime": 0,
"eta": "9:41:12",
"etd": "9:41:12",
"distance": 974,
"order": 3
}
],
"totalWeight": 0,
"vehicleMaxWeight": 100,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"speed": 25,
"totalTravelTime": 69,
"totalDistance": 27996,
"totalVisitTime": 34,
"totalWaitingTime": 0,
"totalSpentTime": 103
}
],
"dropped": [
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": null,
"endTime": null
},
"visitTime": "20",
"capacity": {
"weight": 20.12345
},
"tags": [
"63da418fc05c0d0269071cf2"
],
"assignedVehicleId": "63da418fc05c0d0269071cf2",
"isHub": false,
"reason": "No vehicle with matching tags",
"visitId": "taskId-63970a49cc6ae973f90929e2",
"visitName": "Visit 2"
}
]
}
}
'import requests
url = "https://apiweb.mile.app/api/v3/result/{resultId}"
payload = { "result": {
"routing": [
{
"vehicleId": "63da418fc05c0d0269071cf3",
"vehicleName": "B001ACB 1",
"assignee": "roberto@mile.app",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
},
"vehicleTags": ["West", "Odd"],
"trips": [
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": True,
"weight": 0,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "8:00:00",
"etd": "8:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "taskId-63994a54e1528d445641d9a2",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.261532638313604,106.80685970157342",
"isHub": False,
"tags": ["West", "Odd"],
"timeWindow": {
"startTime": None,
"endTime": None
},
"weight": 0,
"travelTime": 31,
"visitTime": 17,
"waitingTime": 0,
"eta": "8:30:46",
"etd": "8:47:46",
"distance": 12817,
"order": 1
},
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": True,
"weight": 0,
"travelTime": 3,
"visitTime": 0,
"waitingTime": 0,
"eta": "9:41:12",
"etd": "9:41:12",
"distance": 974,
"order": 3
}
],
"totalWeight": 0,
"vehicleMaxWeight": 100,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"speed": 25,
"totalTravelTime": 69,
"totalDistance": 27996,
"totalVisitTime": 34,
"totalWaitingTime": 0,
"totalSpentTime": 103
}
],
"dropped": [
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": None,
"endTime": None
},
"visitTime": "20",
"capacity": { "weight": 20.12345 },
"tags": ["63da418fc05c0d0269071cf2"],
"assignedVehicleId": "63da418fc05c0d0269071cf2",
"isHub": False,
"reason": "No vehicle with matching tags",
"visitId": "taskId-63970a49cc6ae973f90929e2",
"visitName": "Visit 2"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
result: {
routing: [
{
vehicleId: '63da418fc05c0d0269071cf3',
vehicleName: 'B001ACB 1',
assignee: 'roberto@mile.app',
workingTime: {startTime: '08:00', endTime: '17:00'},
vehicleTags: ['West', 'Odd'],
trips: [
{
visitId: 'hub-635f6ad98e47b604ed5f5e09',
coordinate: '-6.17148,106.82649',
isHub: true,
weight: 0,
travelTime: 0,
visitTime: 0,
waitingTime: 0,
eta: '8:00:00',
etd: '8:00:00',
distance: 0,
order: 0
},
{
visitId: 'taskId-63994a54e1528d445641d9a2',
visitName: 'Visit 1',
address: 'Neo Soho, Jakarta Barat',
coordinate: '-6.261532638313604,106.80685970157342',
isHub: false,
tags: ['West', 'Odd'],
timeWindow: {startTime: null, endTime: null},
weight: 0,
travelTime: 31,
visitTime: 17,
waitingTime: 0,
eta: '8:30:46',
etd: '8:47:46',
distance: 12817,
order: 1
},
{
visitId: 'hub-635f6ad98e47b604ed5f5e09',
coordinate: '-6.17148,106.82649',
isHub: true,
weight: 0,
travelTime: 3,
visitTime: 0,
waitingTime: 0,
eta: '9:41:12',
etd: '9:41:12',
distance: 974,
order: 3
}
],
totalWeight: 0,
vehicleMaxWeight: 100,
vehicleMinWeight: 0,
weightPercentage: '0%',
speed: 25,
totalTravelTime: 69,
totalDistance: 27996,
totalVisitTime: 34,
totalWaitingTime: 0,
totalSpentTime: 103
}
],
dropped: [
{
id: 'taskId-63970a49cc6ae973f90929e2',
name: 'Visit 2',
address: 'Gambir Jakarta',
coordinate: '-6.17148,106.82649',
timeWindow: {startTime: null, endTime: null},
visitTime: '20',
capacity: {weight: 20.12345},
tags: ['63da418fc05c0d0269071cf2'],
assignedVehicleId: '63da418fc05c0d0269071cf2',
isHub: false,
reason: 'No vehicle with matching tags',
visitId: 'taskId-63970a49cc6ae973f90929e2',
visitName: 'Visit 2'
}
]
}
})
};
fetch('https://apiweb.mile.app/api/v3/result/{resultId}', 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/result/{resultId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'result' => [
'routing' => [
[
'vehicleId' => '63da418fc05c0d0269071cf3',
'vehicleName' => 'B001ACB 1',
'assignee' => 'roberto@mile.app',
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00'
],
'vehicleTags' => [
'West',
'Odd'
],
'trips' => [
[
'visitId' => 'hub-635f6ad98e47b604ed5f5e09',
'coordinate' => '-6.17148,106.82649',
'isHub' => true,
'weight' => 0,
'travelTime' => 0,
'visitTime' => 0,
'waitingTime' => 0,
'eta' => '8:00:00',
'etd' => '8:00:00',
'distance' => 0,
'order' => 0
],
[
'visitId' => 'taskId-63994a54e1528d445641d9a2',
'visitName' => 'Visit 1',
'address' => 'Neo Soho, Jakarta Barat',
'coordinate' => '-6.261532638313604,106.80685970157342',
'isHub' => false,
'tags' => [
'West',
'Odd'
],
'timeWindow' => [
'startTime' => null,
'endTime' => null
],
'weight' => 0,
'travelTime' => 31,
'visitTime' => 17,
'waitingTime' => 0,
'eta' => '8:30:46',
'etd' => '8:47:46',
'distance' => 12817,
'order' => 1
],
[
'visitId' => 'hub-635f6ad98e47b604ed5f5e09',
'coordinate' => '-6.17148,106.82649',
'isHub' => true,
'weight' => 0,
'travelTime' => 3,
'visitTime' => 0,
'waitingTime' => 0,
'eta' => '9:41:12',
'etd' => '9:41:12',
'distance' => 974,
'order' => 3
]
],
'totalWeight' => 0,
'vehicleMaxWeight' => 100,
'vehicleMinWeight' => 0,
'weightPercentage' => '0%',
'speed' => 25,
'totalTravelTime' => 69,
'totalDistance' => 27996,
'totalVisitTime' => 34,
'totalWaitingTime' => 0,
'totalSpentTime' => 103
]
],
'dropped' => [
[
'id' => 'taskId-63970a49cc6ae973f90929e2',
'name' => 'Visit 2',
'address' => 'Gambir Jakarta',
'coordinate' => '-6.17148,106.82649',
'timeWindow' => [
'startTime' => null,
'endTime' => null
],
'visitTime' => '20',
'capacity' => [
'weight' => 20.12345
],
'tags' => [
'63da418fc05c0d0269071cf2'
],
'assignedVehicleId' => '63da418fc05c0d0269071cf2',
'isHub' => false,
'reason' => 'No vehicle with matching tags',
'visitId' => 'taskId-63970a49cc6ae973f90929e2',
'visitName' => 'Visit 2'
]
]
]
]),
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/result/{resultId}"
payload := strings.NewReader("{\n \"result\": {\n \"routing\": [\n {\n \"vehicleId\": \"63da418fc05c0d0269071cf3\",\n \"vehicleName\": \"B001ACB 1\",\n \"assignee\": \"roberto@mile.app\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n },\n \"vehicleTags\": [\n \"West\",\n \"Odd\"\n ],\n \"trips\": [\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 0,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"8:00:00\",\n \"etd\": \"8:00:00\",\n \"distance\": 0,\n \"order\": 0\n },\n {\n \"visitId\": \"taskId-63994a54e1528d445641d9a2\",\n \"visitName\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.261532638313604,106.80685970157342\",\n \"isHub\": false,\n \"tags\": [\n \"West\",\n \"Odd\"\n ],\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"weight\": 0,\n \"travelTime\": 31,\n \"visitTime\": 17,\n \"waitingTime\": 0,\n \"eta\": \"8:30:46\",\n \"etd\": \"8:47:46\",\n \"distance\": 12817,\n \"order\": 1\n },\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 3,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"9:41:12\",\n \"etd\": \"9:41:12\",\n \"distance\": 974,\n \"order\": 3\n }\n ],\n \"totalWeight\": 0,\n \"vehicleMaxWeight\": 100,\n \"vehicleMinWeight\": 0,\n \"weightPercentage\": \"0%\",\n \"speed\": 25,\n \"totalTravelTime\": 69,\n \"totalDistance\": 27996,\n \"totalVisitTime\": 34,\n \"totalWaitingTime\": 0,\n \"totalSpentTime\": 103\n }\n ],\n \"dropped\": [\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"visitTime\": \"20\",\n \"capacity\": {\n \"weight\": 20.12345\n },\n \"tags\": [\n \"63da418fc05c0d0269071cf2\"\n ],\n \"assignedVehicleId\": \"63da418fc05c0d0269071cf2\",\n \"isHub\": false,\n \"reason\": \"No vehicle with matching tags\",\n \"visitId\": \"taskId-63970a49cc6ae973f90929e2\",\n \"visitName\": \"Visit 2\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://apiweb.mile.app/api/v3/result/{resultId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"result\": {\n \"routing\": [\n {\n \"vehicleId\": \"63da418fc05c0d0269071cf3\",\n \"vehicleName\": \"B001ACB 1\",\n \"assignee\": \"roberto@mile.app\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n },\n \"vehicleTags\": [\n \"West\",\n \"Odd\"\n ],\n \"trips\": [\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 0,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"8:00:00\",\n \"etd\": \"8:00:00\",\n \"distance\": 0,\n \"order\": 0\n },\n {\n \"visitId\": \"taskId-63994a54e1528d445641d9a2\",\n \"visitName\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.261532638313604,106.80685970157342\",\n \"isHub\": false,\n \"tags\": [\n \"West\",\n \"Odd\"\n ],\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"weight\": 0,\n \"travelTime\": 31,\n \"visitTime\": 17,\n \"waitingTime\": 0,\n \"eta\": \"8:30:46\",\n \"etd\": \"8:47:46\",\n \"distance\": 12817,\n \"order\": 1\n },\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 3,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"9:41:12\",\n \"etd\": \"9:41:12\",\n \"distance\": 974,\n \"order\": 3\n }\n ],\n \"totalWeight\": 0,\n \"vehicleMaxWeight\": 100,\n \"vehicleMinWeight\": 0,\n \"weightPercentage\": \"0%\",\n \"speed\": 25,\n \"totalTravelTime\": 69,\n \"totalDistance\": 27996,\n \"totalVisitTime\": 34,\n \"totalWaitingTime\": 0,\n \"totalSpentTime\": 103\n }\n ],\n \"dropped\": [\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"visitTime\": \"20\",\n \"capacity\": {\n \"weight\": 20.12345\n },\n \"tags\": [\n \"63da418fc05c0d0269071cf2\"\n ],\n \"assignedVehicleId\": \"63da418fc05c0d0269071cf2\",\n \"isHub\": false,\n \"reason\": \"No vehicle with matching tags\",\n \"visitId\": \"taskId-63970a49cc6ae973f90929e2\",\n \"visitName\": \"Visit 2\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/result/{resultId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"result\": {\n \"routing\": [\n {\n \"vehicleId\": \"63da418fc05c0d0269071cf3\",\n \"vehicleName\": \"B001ACB 1\",\n \"assignee\": \"roberto@mile.app\",\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\"\n },\n \"vehicleTags\": [\n \"West\",\n \"Odd\"\n ],\n \"trips\": [\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 0,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"8:00:00\",\n \"etd\": \"8:00:00\",\n \"distance\": 0,\n \"order\": 0\n },\n {\n \"visitId\": \"taskId-63994a54e1528d445641d9a2\",\n \"visitName\": \"Visit 1\",\n \"address\": \"Neo Soho, Jakarta Barat\",\n \"coordinate\": \"-6.261532638313604,106.80685970157342\",\n \"isHub\": false,\n \"tags\": [\n \"West\",\n \"Odd\"\n ],\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"weight\": 0,\n \"travelTime\": 31,\n \"visitTime\": 17,\n \"waitingTime\": 0,\n \"eta\": \"8:30:46\",\n \"etd\": \"8:47:46\",\n \"distance\": 12817,\n \"order\": 1\n },\n {\n \"visitId\": \"hub-635f6ad98e47b604ed5f5e09\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"isHub\": true,\n \"weight\": 0,\n \"travelTime\": 3,\n \"visitTime\": 0,\n \"waitingTime\": 0,\n \"eta\": \"9:41:12\",\n \"etd\": \"9:41:12\",\n \"distance\": 974,\n \"order\": 3\n }\n ],\n \"totalWeight\": 0,\n \"vehicleMaxWeight\": 100,\n \"vehicleMinWeight\": 0,\n \"weightPercentage\": \"0%\",\n \"speed\": 25,\n \"totalTravelTime\": 69,\n \"totalDistance\": 27996,\n \"totalVisitTime\": 34,\n \"totalWaitingTime\": 0,\n \"totalSpentTime\": 103\n }\n ],\n \"dropped\": [\n {\n \"id\": \"taskId-63970a49cc6ae973f90929e2\",\n \"name\": \"Visit 2\",\n \"address\": \"Gambir Jakarta\",\n \"coordinate\": \"-6.17148,106.82649\",\n \"timeWindow\": {\n \"startTime\": null,\n \"endTime\": null\n },\n \"visitTime\": \"20\",\n \"capacity\": {\n \"weight\": 20.12345\n },\n \"tags\": [\n \"63da418fc05c0d0269071cf2\"\n ],\n \"assignedVehicleId\": \"63da418fc05c0d0269071cf2\",\n \"isHub\": false,\n \"reason\": \"No vehicle with matching tags\",\n \"visitId\": \"taskId-63970a49cc6ae973f90929e2\",\n \"visitName\": \"Visit 2\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"property": {
"_id": "6352736c628401059b37a2e2",
"name": "Result Today",
"result": {
"resultCode": "Route-20230801-001",
"routing": [
{
"vehicleId": "63da418fc05c0d0269071cf3",
"vehicleName": "B001ACB 1",
"assignee": "roberto@mile.app",
"workingTime": {
"startTime": "08:00",
"endTime": "17:00"
},
"vehicleTags": [
"West",
"Odd"
],
"isOddEven": true,
"oddEven": "even",
"trips": [
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 0,
"visitTime": 0,
"waitingTime": 0,
"eta": "8:00:00",
"etd": "8:00:00",
"distance": 0,
"order": 0
},
{
"visitId": "taskId-63994a54e1528d445641d9a2",
"visitName": "Visit 1",
"address": "Neo Soho, Jakarta Barat",
"coordinate": "-6.261532638313604,106.80685970157342",
"isHub": false,
"tags": [
"West",
"Odd"
],
"timeWindow": {
"startTime": null,
"endTime": null
},
"weight": 0,
"travelTime": 31,
"visitTime": 17,
"waitingTime": 0,
"eta": "8:30:46",
"etd": "8:47:46",
"distance": 12817,
"order": 1,
"allowOddEven": true
},
{
"visitId": "hub-635f6ad98e47b604ed5f5e09",
"coordinate": "-6.17148,106.82649",
"isHub": true,
"weight": 0,
"travelTime": 3,
"visitTime": 0,
"waitingTime": 0,
"eta": "9:41:12",
"etd": "9:41:12",
"distance": 974,
"order": 3
}
],
"totalWeight": 0,
"vehicleMaxWeight": 100,
"vehicleMinWeight": 0,
"weightPercentage": "0%",
"fixedCost": 0,
"totalNodes": 3,
"totalVisits": 1,
"speed": 25,
"totalTravelTime": 69,
"totalDistance": 27996,
"totalVisitTime": 34,
"totalWaitingTime": 0,
"totalSpentTime": 103
}
],
"dropped": [
{
"id": "taskId-63970a49cc6ae973f90929e2",
"name": "Visit 2",
"address": "Gambir Jakarta",
"coordinate": "-6.17148,106.82649",
"timeWindow": {
"startTime": null,
"endTime": null
},
"visitTime": "20",
"capacity": {
"weight": 20.12345
},
"tags": [
"63da418fc05c0d0269071cf2"
],
"assignedVehicleId": "63da418fc05c0d0269071cf2",
"isHub": false,
"reason": "No vehicle with matching tags",
"visitId": "taskId-63970a49cc6ae973f90929e2",
"visitName": "Visit 2"
}
],
"summary": {
"routedVisits": 1,
"droppedVisits": 1,
"totalVisits": 2,
"usedVehicles": 1,
"unusedVehicles": 0,
"totalVehicles": 1,
"totalDistance": 22666,
"totalTravelTime": 34,
"totalVisitTime": 12,
"totalWaitingTime": 0,
"totalSpentTime": 22712,
"minFinishTime": "09:41:12",
"maxFinishTime": "09:41:12",
"avgFinishTime": "09:41:12",
"avgSpeed": 30,
"capacityConstraint": [
{
"name": "weight",
"optimized": 100,
"available": 300,
"percentage": 33.3
}
]
}
},
"hubId": "635f6ad98e47b604ed5f5e09",
"hubCoordinate": "-6.17148,106.82649",
"configurationId": null,
"configuration": {
"defaultVisitTime": 10,
"defaultSpeed": 15,
"multitrip": false,
"returnToHub": true,
"useAllVehicle": true,
"clustering": false,
"capacityConstraint": [
"weight"
],
"name": "Configuration Default",
"autoSpeed": false,
"tripsPerVehicle": -1,
"useOddEven": true,
"oddEvenTime": [
{
"startTime": "07:00",
"endTime": "10:00"
},
{
"startTime": "17:00",
"endTime": "20:00"
}
]
},
"routingDate": "2023-08-08",
"createdTime": "2023-02-06T01:18:36+00:00",
"resultTotal": {
"routing": 1,
"dropped": 1,
"total": 2
},
"organizationId": "635f6a998e47b604ed5f5e02",
"createdBy": "635f6a9a8e47b604ed5f5e08",
"updatedTime": "2023-02-06T06:59:03+00:00",
"user": {
"name": "Marshall Teach"
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Authorizations
Use a valid Bearer token to authenticate.
Path Parameters
Unique identifier for the routing result that generated by system.
Example: 6352736c628401059b37a2e2
Body
The routing result which includes information about countryCode, resultCode, routing details, and dropped results.
Show child attributes
Show child attributes