Create a route
curl --request POST \
--url https://api.maalbar.dk/v1/logistics/routes \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"fromTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
},
"toTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
},
"transportRouteLegs": [
{
"distance": 123,
"emptyReturnFactor": 0,
"isCargoLoadedOnPallets": true,
"method": {
"publicId": "transportMethod_xxxxxxxxxxxx"
},
"order": 123,
"note": "<string>"
}
]
}
'const url = 'https://api.maalbar.dk/v1/logistics/routes';
const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromTransportLocation: {publicId: 'transportLocation_xxxxxxxxxxxx'},
toTransportLocation: {publicId: 'transportLocation_xxxxxxxxxxxx'},
transportRouteLegs: [
{
distance: 123,
emptyReturnFactor: 0,
isCargoLoadedOnPallets: true,
method: {publicId: 'transportMethod_xxxxxxxxxxxx'},
order: 123,
note: '<string>'
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"publicId": "transportRoute_xxxxxxxxxxxx",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"fromTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
},
"toTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
}
}{
"error": "Invalid request parameters"
}{
"error": "Authentication required"
}{
"error": "Resource not found"
}{
"error": "An unexpected error occurred"
}Routes
Create a route
Create a route for the current customer
POST
/
logistics
/
routes
Create a route
curl --request POST \
--url https://api.maalbar.dk/v1/logistics/routes \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"fromTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
},
"toTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
},
"transportRouteLegs": [
{
"distance": 123,
"emptyReturnFactor": 0,
"isCargoLoadedOnPallets": true,
"method": {
"publicId": "transportMethod_xxxxxxxxxxxx"
},
"order": 123,
"note": "<string>"
}
]
}
'const url = 'https://api.maalbar.dk/v1/logistics/routes';
const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromTransportLocation: {publicId: 'transportLocation_xxxxxxxxxxxx'},
toTransportLocation: {publicId: 'transportLocation_xxxxxxxxxxxx'},
transportRouteLegs: [
{
distance: 123,
emptyReturnFactor: 0,
isCargoLoadedOnPallets: true,
method: {publicId: 'transportMethod_xxxxxxxxxxxx'},
order: 123,
note: '<string>'
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"publicId": "transportRoute_xxxxxxxxxxxx",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"fromTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
},
"toTransportLocation": {
"publicId": "transportLocation_xxxxxxxxxxxx"
}
}{
"error": "Invalid request parameters"
}{
"error": "Authentication required"
}{
"error": "Resource not found"
}{
"error": "An unexpected error occurred"
}Authorizations
Body
application/json