Get a transport lane
curl --request GET \
--url https://app.variable.global/api/v1/transport/lane/{uuid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.variable.global/api/v1/transport/lane/{uuid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.variable.global/api/v1/transport/lane/{uuid}', 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://app.variable.global/api/v1/transport/lane/{uuid}",
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://app.variable.global/api/v1/transport/lane/{uuid}"
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://app.variable.global/api/v1/transport/lane/{uuid}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/transport/lane/{uuid}")
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{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name",
"created": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-31T23:59:59.000Z",
"syncId": "sync123",
"totalKm": 6042.3,
"taxonomy": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Material",
"path": "material"
},
"CO2ePerTkm": "0.0412",
"legs": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order": 1,
"mode": "truck",
"origin": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Newark, NJ, USA",
"countryCode": "US",
"latitude": 40.7357,
"longitude": -74.1724
},
"destination": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Newark, NJ, USA",
"countryCode": "US",
"latitude": 40.7357,
"longitude": -74.1724
},
"distance": {
"quantity": 18.4,
"unit": "kg"
},
"CO2ePerTkm": "0.1083"
}
]
}{
"message": "token expired"
}Transport Lane
Get Transport Lane
Get a transport lane by UUID or syncId
GET
/
v1
/
transport
/
lane
/
{uuid}
Get a transport lane
curl --request GET \
--url https://app.variable.global/api/v1/transport/lane/{uuid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.variable.global/api/v1/transport/lane/{uuid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.variable.global/api/v1/transport/lane/{uuid}', 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://app.variable.global/api/v1/transport/lane/{uuid}",
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://app.variable.global/api/v1/transport/lane/{uuid}"
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://app.variable.global/api/v1/transport/lane/{uuid}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/transport/lane/{uuid}")
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{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name",
"created": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-31T23:59:59.000Z",
"syncId": "sync123",
"totalKm": 6042.3,
"taxonomy": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Material",
"path": "material"
},
"CO2ePerTkm": "0.0412",
"legs": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order": 1,
"mode": "truck",
"origin": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Newark, NJ, USA",
"countryCode": "US",
"latitude": 40.7357,
"longitude": -74.1724
},
"destination": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Newark, NJ, USA",
"countryCode": "US",
"latitude": 40.7357,
"longitude": -74.1724
},
"distance": {
"quantity": 18.4,
"unit": "kg"
},
"CO2ePerTkm": "0.1083"
}
]
}{
"message": "token expired"
}Requires permission: element:read
Authorizations
Response
A transport lane
A freight route of one or more ordered legs, sent inline (there is no standalone leg endpoint). name is synthesized from the first leg's origin and the last leg's destination when not set.