Bulk create vehicle
curl --request POST \
--url https://apiweb.mile.app/api/v3/vehicles/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vehicles": [
{
"name": "Mini Van 24",
"assignee": "roberto@mile.app",
"speed": 30,
"fixedCost": 15,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969",
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
}
},
{
"name": "Mini Van 25",
"assignee": "",
"speed": 30,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969"
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/vehicles/"
payload = { "vehicles": [
{
"name": "Mini Van 24",
"assignee": "roberto@mile.app",
"speed": 30,
"fixedCost": 15,
"tags": ["Ganjil", "Depok", "B1124CC"],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969",
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
}
},
{
"name": "Mini Van 25",
"assignee": "",
"speed": 30,
"tags": ["Ganjil", "Depok", "B1124CC"],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969"
}
] }
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({
vehicles: [
{
name: 'Mini Van 24',
assignee: 'roberto@mile.app',
speed: 30,
fixedCost: 15,
tags: ['Ganjil', 'Depok', 'B1124CC'],
workingTime: {startTime: '08:00', endTime: '17:00', multiday: 0},
breakTime: {startTime: '11:00', endTime: '11:30'},
hubId: '621dd813eb3ebf16b94d6969',
capacity: {width: {min: 10, max: 1000}, heigh: {min: 10, max: 1000}}
},
{
name: 'Mini Van 25',
assignee: '',
speed: 30,
tags: ['Ganjil', 'Depok', 'B1124CC'],
workingTime: {startTime: '08:00', endTime: '17:00', multiday: 0},
breakTime: {startTime: '11:00', endTime: '11:30'},
hubId: '621dd813eb3ebf16b94d6969'
}
]
})
};
fetch('https://apiweb.mile.app/api/v3/vehicles/', 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/vehicles/",
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([
'vehicles' => [
[
'name' => 'Mini Van 24',
'assignee' => 'roberto@mile.app',
'speed' => 30,
'fixedCost' => 15,
'tags' => [
'Ganjil',
'Depok',
'B1124CC'
],
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00',
'multiday' => 0
],
'breakTime' => [
'startTime' => '11:00',
'endTime' => '11:30'
],
'hubId' => '621dd813eb3ebf16b94d6969',
'capacity' => [
'width' => [
'min' => 10,
'max' => 1000
],
'heigh' => [
'min' => 10,
'max' => 1000
]
]
],
[
'name' => 'Mini Van 25',
'assignee' => '',
'speed' => 30,
'tags' => [
'Ganjil',
'Depok',
'B1124CC'
],
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00',
'multiday' => 0
],
'breakTime' => [
'startTime' => '11:00',
'endTime' => '11:30'
],
'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/vehicles/"
payload := strings.NewReader("{\n \"vehicles\": [\n {\n \"name\": \"Mini Van 24\",\n \"assignee\": \"roberto@mile.app\",\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 \"hubId\": \"621dd813eb3ebf16b94d6969\",\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n }\n },\n {\n \"name\": \"Mini Van 25\",\n \"assignee\": \"\",\n \"speed\": 30,\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 \"hubId\": \"621dd813eb3ebf16b94d6969\"\n }\n ]\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/vehicles/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vehicles\": [\n {\n \"name\": \"Mini Van 24\",\n \"assignee\": \"roberto@mile.app\",\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 \"hubId\": \"621dd813eb3ebf16b94d6969\",\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n }\n },\n {\n \"name\": \"Mini Van 25\",\n \"assignee\": \"\",\n \"speed\": 30,\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 \"hubId\": \"621dd813eb3ebf16b94d6969\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/vehicles/")
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 \"vehicles\": [\n {\n \"name\": \"Mini Van 24\",\n \"assignee\": \"roberto@mile.app\",\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 \"hubId\": \"621dd813eb3ebf16b94d6969\",\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n }\n },\n {\n \"name\": \"Mini Van 25\",\n \"assignee\": \"\",\n \"speed\": 30,\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 \"hubId\": \"621dd813eb3ebf16b94d6969\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": 2,
"failed": 0,
"data": [
{
"_id": "62ce3918d3f3e1681a3a54b2",
"message": "Success"
},
{
"_id": "62ce3918d3f3e1681a3a8237",
"message": "Success"
}
]
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Vehicle
Bulk create vehicle
POST
/
vehicles
/
Bulk create vehicle
curl --request POST \
--url https://apiweb.mile.app/api/v3/vehicles/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vehicles": [
{
"name": "Mini Van 24",
"assignee": "roberto@mile.app",
"speed": 30,
"fixedCost": 15,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969",
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
}
},
{
"name": "Mini Van 25",
"assignee": "",
"speed": 30,
"tags": [
"Ganjil",
"Depok",
"B1124CC"
],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969"
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/vehicles/"
payload = { "vehicles": [
{
"name": "Mini Van 24",
"assignee": "roberto@mile.app",
"speed": 30,
"fixedCost": 15,
"tags": ["Ganjil", "Depok", "B1124CC"],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969",
"capacity": {
"width": {
"min": 10,
"max": 1000
},
"heigh": {
"min": 10,
"max": 1000
}
}
},
{
"name": "Mini Van 25",
"assignee": "",
"speed": 30,
"tags": ["Ganjil", "Depok", "B1124CC"],
"workingTime": {
"startTime": "08:00",
"endTime": "17:00",
"multiday": 0
},
"breakTime": {
"startTime": "11:00",
"endTime": "11:30"
},
"hubId": "621dd813eb3ebf16b94d6969"
}
] }
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({
vehicles: [
{
name: 'Mini Van 24',
assignee: 'roberto@mile.app',
speed: 30,
fixedCost: 15,
tags: ['Ganjil', 'Depok', 'B1124CC'],
workingTime: {startTime: '08:00', endTime: '17:00', multiday: 0},
breakTime: {startTime: '11:00', endTime: '11:30'},
hubId: '621dd813eb3ebf16b94d6969',
capacity: {width: {min: 10, max: 1000}, heigh: {min: 10, max: 1000}}
},
{
name: 'Mini Van 25',
assignee: '',
speed: 30,
tags: ['Ganjil', 'Depok', 'B1124CC'],
workingTime: {startTime: '08:00', endTime: '17:00', multiday: 0},
breakTime: {startTime: '11:00', endTime: '11:30'},
hubId: '621dd813eb3ebf16b94d6969'
}
]
})
};
fetch('https://apiweb.mile.app/api/v3/vehicles/', 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/vehicles/",
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([
'vehicles' => [
[
'name' => 'Mini Van 24',
'assignee' => 'roberto@mile.app',
'speed' => 30,
'fixedCost' => 15,
'tags' => [
'Ganjil',
'Depok',
'B1124CC'
],
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00',
'multiday' => 0
],
'breakTime' => [
'startTime' => '11:00',
'endTime' => '11:30'
],
'hubId' => '621dd813eb3ebf16b94d6969',
'capacity' => [
'width' => [
'min' => 10,
'max' => 1000
],
'heigh' => [
'min' => 10,
'max' => 1000
]
]
],
[
'name' => 'Mini Van 25',
'assignee' => '',
'speed' => 30,
'tags' => [
'Ganjil',
'Depok',
'B1124CC'
],
'workingTime' => [
'startTime' => '08:00',
'endTime' => '17:00',
'multiday' => 0
],
'breakTime' => [
'startTime' => '11:00',
'endTime' => '11:30'
],
'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/vehicles/"
payload := strings.NewReader("{\n \"vehicles\": [\n {\n \"name\": \"Mini Van 24\",\n \"assignee\": \"roberto@mile.app\",\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 \"hubId\": \"621dd813eb3ebf16b94d6969\",\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n }\n },\n {\n \"name\": \"Mini Van 25\",\n \"assignee\": \"\",\n \"speed\": 30,\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 \"hubId\": \"621dd813eb3ebf16b94d6969\"\n }\n ]\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/vehicles/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vehicles\": [\n {\n \"name\": \"Mini Van 24\",\n \"assignee\": \"roberto@mile.app\",\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 \"hubId\": \"621dd813eb3ebf16b94d6969\",\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n }\n },\n {\n \"name\": \"Mini Van 25\",\n \"assignee\": \"\",\n \"speed\": 30,\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 \"hubId\": \"621dd813eb3ebf16b94d6969\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/vehicles/")
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 \"vehicles\": [\n {\n \"name\": \"Mini Van 24\",\n \"assignee\": \"roberto@mile.app\",\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 \"hubId\": \"621dd813eb3ebf16b94d6969\",\n \"capacity\": {\n \"width\": {\n \"min\": 10,\n \"max\": 1000\n },\n \"heigh\": {\n \"min\": 10,\n \"max\": 1000\n }\n }\n },\n {\n \"name\": \"Mini Van 25\",\n \"assignee\": \"\",\n \"speed\": 30,\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 \"hubId\": \"621dd813eb3ebf16b94d6969\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": 2,
"failed": 0,
"data": [
{
"_id": "62ce3918d3f3e1681a3a54b2",
"message": "Success"
},
{
"_id": "62ce3918d3f3e1681a3a8237",
"message": "Success"
}
]
}{
"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
application/json
Show child attributes
Show child attributes
⌘I