Update a route
curl --request PUT \
--url https://api.maalbar.dk/v1/logistics/routes/{routePublicId} \
--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>"
}
],
"publicId": "transportRoute_xxxxxxxxxxxx"
}
'const url = 'https://api.maalbar.dk/v1/logistics/routes/{routePublicId}';
const options = {
method: 'PUT',
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>'
}
],
publicId: 'transportRoute_xxxxxxxxxxxx'
})
};
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
Update a route
PUT
/
logistics
/
routes
/
{routePublicId}
Update a route
curl --request PUT \
--url https://api.maalbar.dk/v1/logistics/routes/{routePublicId} \
--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>"
}
],
"publicId": "transportRoute_xxxxxxxxxxxx"
}
'const url = 'https://api.maalbar.dk/v1/logistics/routes/{routePublicId}';
const options = {
method: 'PUT',
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>'
}
],
publicId: 'transportRoute_xxxxxxxxxxxx'
})
};
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
Path Parameters
Body
application/json