curl --request POST \
--url https://app.variable.global/api/v1/transport/lane \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name",
"created": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-31T23:59:59.000Z",
"syncId": "sync123",
"taxonomy": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Material",
"path": "material"
},
"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"
}
}
]
}
'import requests
url = "https://app.variable.global/api/v1/transport/lane"
payload = {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name",
"created": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-31T23:59:59.000Z",
"syncId": "sync123",
"taxonomy": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Material",
"path": "material"
},
"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"
}
}
]
}
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({
uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Name',
created: '2021-01-01T00:00:00.000Z',
updated: '2021-01-31T23:59:59.000Z',
syncId: 'sync123',
taxonomy: {
uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Material',
path: 'material'
},
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'}
}
]
})
};
fetch('https://app.variable.global/api/v1/transport/lane', 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",
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([
'uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Name',
'created' => '2021-01-01T00:00:00.000Z',
'updated' => '2021-01-31T23:59:59.000Z',
'syncId' => 'sync123',
'taxonomy' => [
'uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Material',
'path' => 'material'
],
'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'
]
]
]
]),
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://app.variable.global/api/v1/transport/lane"
payload := strings.NewReader("{\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Name\",\n \"created\": \"2021-01-01T00:00:00.000Z\",\n \"updated\": \"2021-01-31T23:59:59.000Z\",\n \"syncId\": \"sync123\",\n \"taxonomy\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Material\",\n \"path\": \"material\"\n },\n \"legs\": [\n {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"order\": 1,\n \"mode\": \"truck\",\n \"origin\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"destination\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"distance\": {\n \"quantity\": 18.4,\n \"unit\": \"kg\"\n }\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://app.variable.global/api/v1/transport/lane")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Name\",\n \"created\": \"2021-01-01T00:00:00.000Z\",\n \"updated\": \"2021-01-31T23:59:59.000Z\",\n \"syncId\": \"sync123\",\n \"taxonomy\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Material\",\n \"path\": \"material\"\n },\n \"legs\": [\n {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"order\": 1,\n \"mode\": \"truck\",\n \"origin\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"destination\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"distance\": {\n \"quantity\": 18.4,\n \"unit\": \"kg\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/transport/lane")
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 \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Name\",\n \"created\": \"2021-01-01T00:00:00.000Z\",\n \"updated\": \"2021-01-31T23:59:59.000Z\",\n \"syncId\": \"sync123\",\n \"taxonomy\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Material\",\n \"path\": \"material\"\n },\n \"legs\": [\n {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"order\": 1,\n \"mode\": \"truck\",\n \"origin\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"destination\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"distance\": {\n \"quantity\": 18.4,\n \"unit\": \"kg\"\n }\n }\n ]\n}"
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"
}Create Transport Lane
Create a transport lane with its legs inline
curl --request POST \
--url https://app.variable.global/api/v1/transport/lane \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name",
"created": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-31T23:59:59.000Z",
"syncId": "sync123",
"taxonomy": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Material",
"path": "material"
},
"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"
}
}
]
}
'import requests
url = "https://app.variable.global/api/v1/transport/lane"
payload = {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name",
"created": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-31T23:59:59.000Z",
"syncId": "sync123",
"taxonomy": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Material",
"path": "material"
},
"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"
}
}
]
}
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({
uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Name',
created: '2021-01-01T00:00:00.000Z',
updated: '2021-01-31T23:59:59.000Z',
syncId: 'sync123',
taxonomy: {
uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Material',
path: 'material'
},
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'}
}
]
})
};
fetch('https://app.variable.global/api/v1/transport/lane', 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",
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([
'uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Name',
'created' => '2021-01-01T00:00:00.000Z',
'updated' => '2021-01-31T23:59:59.000Z',
'syncId' => 'sync123',
'taxonomy' => [
'uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Material',
'path' => 'material'
],
'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'
]
]
]
]),
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://app.variable.global/api/v1/transport/lane"
payload := strings.NewReader("{\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Name\",\n \"created\": \"2021-01-01T00:00:00.000Z\",\n \"updated\": \"2021-01-31T23:59:59.000Z\",\n \"syncId\": \"sync123\",\n \"taxonomy\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Material\",\n \"path\": \"material\"\n },\n \"legs\": [\n {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"order\": 1,\n \"mode\": \"truck\",\n \"origin\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"destination\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"distance\": {\n \"quantity\": 18.4,\n \"unit\": \"kg\"\n }\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://app.variable.global/api/v1/transport/lane")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Name\",\n \"created\": \"2021-01-01T00:00:00.000Z\",\n \"updated\": \"2021-01-31T23:59:59.000Z\",\n \"syncId\": \"sync123\",\n \"taxonomy\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Material\",\n \"path\": \"material\"\n },\n \"legs\": [\n {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"order\": 1,\n \"mode\": \"truck\",\n \"origin\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"destination\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"distance\": {\n \"quantity\": 18.4,\n \"unit\": \"kg\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/transport/lane")
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 \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Name\",\n \"created\": \"2021-01-01T00:00:00.000Z\",\n \"updated\": \"2021-01-31T23:59:59.000Z\",\n \"syncId\": \"sync123\",\n \"taxonomy\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Material\",\n \"path\": \"material\"\n },\n \"legs\": [\n {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"order\": 1,\n \"mode\": \"truck\",\n \"origin\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"destination\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\",\n \"name\": \"Newark, NJ, USA\",\n \"countryCode\": \"US\",\n \"latitude\": 40.7357,\n \"longitude\": -74.1724\n },\n \"distance\": {\n \"quantity\": 18.4,\n \"unit\": \"kg\"\n }\n }\n ]\n}"
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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
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.
"Name"
ISO 8601 date
"2021-01-01T00:00:00.000Z"
ISO 8601 date
"2021-01-31T23:59:59.000Z"
A reference to a taxonomy category, including its machine-readable path.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
The created 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.
"Name"
ISO 8601 date
"2021-01-01T00:00:00.000Z"
ISO 8601 date
"2021-01-31T23:59:59.000Z"
6042.3
A reference to a taxonomy category, including its machine-readable path.
Show child attributes
Show child attributes
Carbon intensity in kg CO2e per tonne-kilometre, not an absolute total — the total only materialises once cargo weight is applied via a transport instance on an activity or input. "0" when genuinely zero, absent when unknown.
"0.0412"
Show child attributes
Show child attributes