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"
}
]
}
}
'{
"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"
}
}
}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"
}
]
}
}
'{
"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"
}
}
}Use a valid Bearer token to authenticate.
Unique identifier for the routing result that generated by system.
Example: 6352736c628401059b37a2e2
The routing result which includes information about countryCode, resultCode, routing details, and dropped results.
Show child attributes