Read capacity constraints
curl --request GET \
--url https://apiweb.mile.app/api/v3/capacity-constraints \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/capacity-constraints"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v3/capacity-constraints', 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/capacity-constraints",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/capacity-constraints"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/capacity-constraints")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/capacity-constraints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"current_page": 1,
"data": [
{
"_id": "6502a184c84b5d2a9c0e7f11",
"organizationId": "64d99303be0ad015c461c932",
"isDeleted": false,
"capacityConstraint": [
{
"id": "1694662020650253c84b5d2a9",
"name": "weight",
"denominator": "kg"
},
{
"id": "1694662020650253c84b5d2b0",
"name": "volume",
"denominator": "m3"
}
],
"createdTime": "2023-09-14T03:27:00.000000Z",
"updatedTime": "2023-09-14T03:27:00.000000Z"
}
],
"total": 1
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Configuration
Read capacity constraints
Lists the capacity constraint document of your organization. An organization has at most one document; it holds the list of capacity types (for example weight or volume) that vehicles and visits are measured in.
Requires the view/configuration permission.
GET
/
capacity-constraints
Read capacity constraints
curl --request GET \
--url https://apiweb.mile.app/api/v3/capacity-constraints \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/capacity-constraints"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v3/capacity-constraints', 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/capacity-constraints",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/capacity-constraints"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/capacity-constraints")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/capacity-constraints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"current_page": 1,
"data": [
{
"_id": "6502a184c84b5d2a9c0e7f11",
"organizationId": "64d99303be0ad015c461c932",
"isDeleted": false,
"capacityConstraint": [
{
"id": "1694662020650253c84b5d2a9",
"name": "weight",
"denominator": "kg"
},
{
"id": "1694662020650253c84b5d2b0",
"name": "volume",
"denominator": "m3"
}
],
"createdTime": "2023-09-14T03:27:00.000000Z",
"updatedTime": "2023-09-14T03:27:00.000000Z"
}
],
"total": 1
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Authorizations
Use a valid Bearer token to authenticate.
Query Parameters
The page number of results to retrieve. Example: 2
Specifies the maximum number of items to retrieve in a single request. Example: 10
Required range:
1 <= x <= 1000Field to sort by.
Default: name
asc or desc.
Default: asc