curl --request PATCH \
--url https://apiweb.mile.app/api/v3/vehicle/{vehicleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Mini Van 35",
"assignee": "[email protected]",
"speed": 30,
"fixedCost": 15,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
},
"hubId": "621dd813eb3ebf16b94d6969"
}
'import requests
url = "https://apiweb.mile.app/api/v3/vehicle/{vehicleId}"
payload = {
"name": "Mini Van 35",
"assignee": "[email protected]",
"speed": 30,
"fixedCost": 15,
"tags": ["Ganjil", "Depok", "B1124CC"],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
},
"hubId": "621dd813eb3ebf16b94d6969"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Mini Van 35',
assignee: '[email protected]',
speed: 30,
fixedCost: 15,
tags: ['Ganjil', 'Depok', 'B1124CC'],
workingTime: {startTime: '08:00', endTime: '17:00', multiday: 0},
breakTime: {startTime: '11:00', endTime: '11:30'},
capacity: {width: {min: 10, max: 1000}, heigh: {min: 10, max: 1000}},
hubId: '621dd813eb3ebf16b94d6969'
})
};
fetch('https://apiweb.mile.app/api/v3/vehicle/{vehicleId}', 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/vehicle/{vehicleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Mini Van 35',
'assignee' => '[email protected]',
'speed' => 30,
'fixedCost' => 15,
'tags' => [
'Ganjil',
'Depok',
'B1124CC'
],
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00',
'multiday' => 0
],
'breakTime' => [
'startTime' => '11:00',
'endTime' => '11:30'
],
'capacity' => [
'width' => [
'min' => 10,
'max' => 1000
],
'heigh' => [
'min' => 10,
'max' => 1000
]
],
'hubId' => '621dd813eb3ebf16b94d6969'
]),
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/vehicle/{vehicleId}"
payload := strings.NewReader("{\n \"name\": \"Mini Van 35\",\n \"assignee\": \"[email protected]\",\n \"speed\": 30,\n \"fixedCost\": 15,\n \"tags\": [\n \"Ganjil\",\n \"Depok\",\n \"B1124CC\"\n ],\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\",\n \"multiday\": 0\n },\n \"breakTime\": {\n \"startTime\": \"11:00\",\n \"endTime\": \"11:30\"\n },\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n },\n \"hubId\": \"621dd813eb3ebf16b94d6969\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://apiweb.mile.app/api/v3/vehicle/{vehicleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Mini Van 35\",\n \"assignee\": \"[email protected]\",\n \"speed\": 30,\n \"fixedCost\": 15,\n \"tags\": [\n \"Ganjil\",\n \"Depok\",\n \"B1124CC\"\n ],\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\",\n \"multiday\": 0\n },\n \"breakTime\": {\n \"startTime\": \"11:00\",\n \"endTime\": \"11:30\"\n },\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n },\n \"hubId\": \"621dd813eb3ebf16b94d6969\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/vehicle/{vehicleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Mini Van 35\",\n \"assignee\": \"[email protected]\",\n \"speed\": 30,\n \"fixedCost\": 15,\n \"tags\": [\n \"Ganjil\",\n \"Depok\",\n \"B1124CC\"\n ],\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\",\n \"multiday\": 0\n },\n \"breakTime\": {\n \"startTime\": \"11:00\",\n \"endTime\": \"11:30\"\n },\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n },\n \"hubId\": \"621dd813eb3ebf16b94d6969\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"name": "Mini Van 35",
"assignee": "[email protected]",
"speed": 30,
"fixedCost": 15,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"height": {
"min": 10,
"max": 1000
}
},
"organizationId": "621dd813eb3ebf16b94dbde3",
"hubId": "621dd813eb3ebf16b94d6969",
"updatedTime": "2022-07-13T03:16:40+00:00",
"createdTime": "2022-07-13T03:16:40+00:00",
"_id": "62ce3918d3f3e1681a3a54b2"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Update partially vehicle by ID
curl --request PATCH \
--url https://apiweb.mile.app/api/v3/vehicle/{vehicleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Mini Van 35",
"assignee": "[email protected]",
"speed": 30,
"fixedCost": 15,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
},
"hubId": "621dd813eb3ebf16b94d6969"
}
'import requests
url = "https://apiweb.mile.app/api/v3/vehicle/{vehicleId}"
payload = {
"name": "Mini Van 35",
"assignee": "[email protected]",
"speed": 30,
"fixedCost": 15,
"tags": ["Ganjil", "Depok", "B1124CC"],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
},
"hubId": "621dd813eb3ebf16b94d6969"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Mini Van 35',
assignee: '[email protected]',
speed: 30,
fixedCost: 15,
tags: ['Ganjil', 'Depok', 'B1124CC'],
workingTime: {startTime: '08:00', endTime: '17:00', multiday: 0},
breakTime: {startTime: '11:00', endTime: '11:30'},
capacity: {width: {min: 10, max: 1000}, heigh: {min: 10, max: 1000}},
hubId: '621dd813eb3ebf16b94d6969'
})
};
fetch('https://apiweb.mile.app/api/v3/vehicle/{vehicleId}', 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/vehicle/{vehicleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Mini Van 35',
'assignee' => '[email protected]',
'speed' => 30,
'fixedCost' => 15,
'tags' => [
'Ganjil',
'Depok',
'B1124CC'
],
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00',
'multiday' => 0
],
'breakTime' => [
'startTime' => '11:00',
'endTime' => '11:30'
],
'capacity' => [
'width' => [
'min' => 10,
'max' => 1000
],
'heigh' => [
'min' => 10,
'max' => 1000
]
],
'hubId' => '621dd813eb3ebf16b94d6969'
]),
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/vehicle/{vehicleId}"
payload := strings.NewReader("{\n \"name\": \"Mini Van 35\",\n \"assignee\": \"[email protected]\",\n \"speed\": 30,\n \"fixedCost\": 15,\n \"tags\": [\n \"Ganjil\",\n \"Depok\",\n \"B1124CC\"\n ],\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\",\n \"multiday\": 0\n },\n \"breakTime\": {\n \"startTime\": \"11:00\",\n \"endTime\": \"11:30\"\n },\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n },\n \"hubId\": \"621dd813eb3ebf16b94d6969\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://apiweb.mile.app/api/v3/vehicle/{vehicleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Mini Van 35\",\n \"assignee\": \"[email protected]\",\n \"speed\": 30,\n \"fixedCost\": 15,\n \"tags\": [\n \"Ganjil\",\n \"Depok\",\n \"B1124CC\"\n ],\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\",\n \"multiday\": 0\n },\n \"breakTime\": {\n \"startTime\": \"11:00\",\n \"endTime\": \"11:30\"\n },\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n },\n \"hubId\": \"621dd813eb3ebf16b94d6969\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/vehicle/{vehicleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Mini Van 35\",\n \"assignee\": \"[email protected]\",\n \"speed\": 30,\n \"fixedCost\": 15,\n \"tags\": [\n \"Ganjil\",\n \"Depok\",\n \"B1124CC\"\n ],\n \"workingTime\": {\n \"startTime\": \"08:00\",\n \"endTime\": \"17:00\",\n \"multiday\": 0\n },\n \"breakTime\": {\n \"startTime\": \"11:00\",\n \"endTime\": \"11:30\"\n },\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n },\n \"hubId\": \"621dd813eb3ebf16b94d6969\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"name": "Mini Van 35",
"assignee": "[email protected]",
"speed": 30,
"fixedCost": 15,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"height": {
"min": 10,
"max": 1000
}
},
"organizationId": "621dd813eb3ebf16b94dbde3",
"hubId": "621dd813eb3ebf16b94d6969",
"updatedTime": "2022-07-13T03:16:40+00:00",
"createdTime": "2022-07-13T03:16:40+00:00",
"_id": "62ce3918d3f3e1681a3a54b2"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Authorizations
Use a valid Bearer token to authenticate.
Path Parameters
Unique identifier for the vehicle that generated by system.
Example: 62ce3918d3f3e1681a3a54b2
Body
The name of vehicle. User can define vehicle name with vehicle's license plate, vehicle brand, or something else.
Example: Mini Van 54
Worker's email that assigned to the vehicle. One vehicle can only be assigned by one worker.
Example: [email protected]
Working hours on vehicles containing: startTime, endTime, and multiday.
Example:
{
'startTime':'08:00',
'endTime':'17:00',
'multiday':0
}
Show child attributes
Show child attributes
Indicates that the data inside represents the break time for the vehicle. containing: startTime, and endTime.
Show child attributes
Show child attributes
Assume the average speed (in km/h) of the vehicle.Speed cannot be less than 5 km/h.
Example: 30
Default: 25
The Cost Factor value range is set from 0 to 100, with the default value being 0. A lower number signifies a higher priority for routing optimization purposes.
Example: 15
Default: 0
The tag is used for route optimization purposes. Visits that have tags will be assigned to vehicles that have the same tags.
Example: ['Ganjil','Depok','B1124CC']
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
Capacity is used for route optimization purposes, it's dynamic based on user needs. It has minimum and maximum value as the limit for the shelter that can be accommodated by the vehicle.
Example:
{
'weight':{'min':10,'max':1000},
'volume':{'min':10,'max':1000}
}
Show child attributes
Show child attributes