curl --request POST \
--url https://apiweb.mile.app/api/v3/reorder-visits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currentCoordinate": "-7.76287840866215,113.24105028153643",
"visits": [
{
"id": "taskId-6865263cdbb431345b0b0a04",
"name": "Order 2",
"address": "Bangil",
"coordinate": "-7.5976243,112.7845343",
"timeWindow": {
"startTime": "07:00",
"endTime": "23:00"
},
"visitTime": "30"
},
{
"id": "taskId-6865263cdbb431345b0b0a02",
"name": "Order 1",
"address": "Probolinggo",
"coordinate": "-7.86316,113.30510534699638",
"timeWindow": {
"startTime": "07:00",
"endTime": "23:00"
},
"visitTime": "30"
}
]
}
'{
"status": true,
"statusCode": 200,
"data": [
{
"status": true,
"message": "Success.",
"_id": "6865263cdbb431345b0b0a02",
"orderIndex": 17515144251
},
{
"status": true,
"message": "Success.",
"_id": "6865263cdbb431345b0b0a04",
"orderIndex": 17515144252
}
]
}This API endpoint allows you to reorder a given list of visits based on the current coordinate, optimizing the sequence of the visits.
curl --request POST \
--url https://apiweb.mile.app/api/v3/reorder-visits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currentCoordinate": "-7.76287840866215,113.24105028153643",
"visits": [
{
"id": "taskId-6865263cdbb431345b0b0a04",
"name": "Order 2",
"address": "Bangil",
"coordinate": "-7.5976243,112.7845343",
"timeWindow": {
"startTime": "07:00",
"endTime": "23:00"
},
"visitTime": "30"
},
{
"id": "taskId-6865263cdbb431345b0b0a02",
"name": "Order 1",
"address": "Probolinggo",
"coordinate": "-7.86316,113.30510534699638",
"timeWindow": {
"startTime": "07:00",
"endTime": "23:00"
},
"visitTime": "30"
}
]
}
'{
"status": true,
"statusCode": 200,
"data": [
{
"status": true,
"message": "Success.",
"_id": "6865263cdbb431345b0b0a02",
"orderIndex": 17515144251
},
{
"status": true,
"message": "Success.",
"_id": "6865263cdbb431345b0b0a04",
"orderIndex": 17515144252
}
]
}Use a valid Bearer token to authenticate.
The current latitude and longitude to calculate the order from.
"-7.76287840866215,113.24105028153643"
List of visits to be reordered.
Show child attributes
Unique identifier for each visit. Visit ID's format might indicate the type of visit. Example visit IDs :
taskId-6311cc36db29775ad01694e6 (Visit related to a task. You can set the visitId with this prefix on the payload of routing to tell the system that the visitId is related to a task.)
The name of the visit, which can be a destination name, customer name, or any relevant identifier for the visit.
Example: 'Visit 1'
Location of the visit, specified as an address. Example: 'Neo Soho, Jakarta Barat'
The geographic coordinates (latitude and longitude) of the visit, used in engine calculations to find the distance and travel time between visits. The format should be latitude,longitude.
Example: '-6.230815251666679,106.75684387903198'
Opening and closing hours as a time span for the destination to be visited. The time window represents the allowable time for arrival at the visit, and it uses the 24-hour format. If not specified, the visit can be visited at any time.
Example: {'startTime': '08:00', 'endTime': '17:00'}
Idle time in minutes after arriving at the destination. This parameter represents the time needed for activities such as goods handover, waiting for customers, parking vehicles, etc., based on business requirements.
Example: 10