Create hub
curl --request POST \
--url https://apiweb.mile.app/api/v3/hub \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Dukuh Atas",
"address": "12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia",
"lat": "-6.205870636762187",
"lng": "106.82562818235002"
}
'import requests
url = "https://apiweb.mile.app/api/v3/hub"
payload = {
"name": "Dukuh Atas",
"address": "12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia",
"lat": "-6.205870636762187",
"lng": "106.82562818235002"
}
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({
name: 'Dukuh Atas',
address: '12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia',
lat: '-6.205870636762187',
lng: '106.82562818235002'
})
};
fetch('https://apiweb.mile.app/api/v3/hub', 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/hub",
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([
'name' => 'Dukuh Atas',
'address' => '12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia',
'lat' => '-6.205870636762187',
'lng' => '106.82562818235002'
]),
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/hub"
payload := strings.NewReader("{\n \"name\": \"Dukuh Atas\",\n \"address\": \"12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia\",\n \"lat\": \"-6.205870636762187\",\n \"lng\": \"106.82562818235002\"\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/hub")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Dukuh Atas\",\n \"address\": \"12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia\",\n \"lat\": \"-6.205870636762187\",\n \"lng\": \"106.82562818235002\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/hub")
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 \"name\": \"Dukuh Atas\",\n \"address\": \"12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia\",\n \"lat\": \"-6.205870636762187\",\n \"lng\": \"106.82562818235002\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"name": "Dukuh Atas",
"address": "12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia",
"lat": -6.205870636762187,
"lng": 106.82562818235002,
"organizationId": "63c76fdb88697c70e35866e2",
"updatedTime": "2023-03-31T01:17:49.158000Z",
"createdTime": "2023-03-31T01:17:49.158000Z",
"_id": "642634bde1428d414838c882",
"deleteAccess": true
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Hub
Create hub
POST
/
hub
Create hub
curl --request POST \
--url https://apiweb.mile.app/api/v3/hub \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Dukuh Atas",
"address": "12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia",
"lat": "-6.205870636762187",
"lng": "106.82562818235002"
}
'import requests
url = "https://apiweb.mile.app/api/v3/hub"
payload = {
"name": "Dukuh Atas",
"address": "12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia",
"lat": "-6.205870636762187",
"lng": "106.82562818235002"
}
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({
name: 'Dukuh Atas',
address: '12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia',
lat: '-6.205870636762187',
lng: '106.82562818235002'
})
};
fetch('https://apiweb.mile.app/api/v3/hub', 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/hub",
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([
'name' => 'Dukuh Atas',
'address' => '12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia',
'lat' => '-6.205870636762187',
'lng' => '106.82562818235002'
]),
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/hub"
payload := strings.NewReader("{\n \"name\": \"Dukuh Atas\",\n \"address\": \"12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia\",\n \"lat\": \"-6.205870636762187\",\n \"lng\": \"106.82562818235002\"\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/hub")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Dukuh Atas\",\n \"address\": \"12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia\",\n \"lat\": \"-6.205870636762187\",\n \"lng\": \"106.82562818235002\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/hub")
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 \"name\": \"Dukuh Atas\",\n \"address\": \"12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia\",\n \"lat\": \"-6.205870636762187\",\n \"lng\": \"106.82562818235002\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"name": "Dukuh Atas",
"address": "12, Jalan Setia Budi VI, Jakarta Selatan 12910, Indonesia",
"lat": -6.205870636762187,
"lng": 106.82562818235002,
"organizationId": "63c76fdb88697c70e35866e2",
"updatedTime": "2023-03-31T01:17:49.158000Z",
"createdTime": "2023-03-31T01:17:49.158000Z",
"_id": "642634bde1428d414838c882",
"deleteAccess": true
}
}{
"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
The name of hub. User can define hub name with hub's location, or something else.
Example: Hub transit Jakarta
Location of the hub. Example: 'Neo Soho, Jakarta Barat'
Coordinate latitude of hub. Example: '-6.230815251666679'
Coordinate longitude of hub. Example: '106.75684387903198'
⌘I