Update Transport Route Attachment
const options = {
method: 'PATCH',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({attachment_file_id: {}})
};
fetch('https://api.dcycle.io/v1/transports/{transport_route_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/transports/{transport_route_id}"
payload = { "attachment_file_id": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.dcycle.io/v1/transports/{transport_route_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"attachment_file_id": {}
}
'{
"attachment": {
"file_id": "<string>",
"file_name": "<string>",
"file_url": "<string>"
}
}Update Transport Route Attachment
Attach a document to a transport route, or remove it, without recalculating the route
PATCH
/
v1
/
transports
/
{transport_route_id}
Update Transport Route Attachment
const options = {
method: 'PATCH',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({attachment_file_id: {}})
};
fetch('https://api.dcycle.io/v1/transports/{transport_route_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/transports/{transport_route_id}"
payload = { "attachment_file_id": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.dcycle.io/v1/transports/{transport_route_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"attachment_file_id": {}
}
'{
"attachment": {
"file_id": "<string>",
"file_name": "<string>",
"file_url": "<string>"
}
}Attach a supporting document to a transport route (e.g. the carrier’s invoice or the delivery note), replace it, or
remove it. Only the attachment changes: a document changes no emissions, so the route keeps its sections, status and
results and is not recalculated. To change anything else, use Update Transport Route,
which also takes
The response is abridged: it carries every field of Get Transport Route.
attachment_file_id.
The attachment is not the file the route was read from (file_id, a spreadsheet upload or a freight invoice). Deleting
the attached file or moving it to the trash unlinks the route, which stays.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
The unique identifier (UUID) of the transport routeExample:
010ed3b6-b513-40f3-b9fe-0f0a338d9274Body
string | null
required
UUID of an
uploaded file of your files to attach to the route: upload it first
(POST /v1/files/presigned-urls with skip_processing: true, the upload, then PATCH /v1/files/batch-update to
uploaded). The file must belong to your organization or one you can write to, and a private file only to the
route’s organization. null removes the attachment. Any other field is rejected (422).Example: "7c9e6679-7425-40de-944b-e07fc1f90ae7"Response
Returns the route as Get Transport Route does (HTTP 200), with itsattachment:
object | null
Example
curl -X PATCH "https://api.dcycle.io/v1/transports/010ed3b6-b513-40f3-b9fe-0f0a338d9274" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{"attachment_file_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"}'
Response (200)
{
"id": "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
"name": "Pallets to Valencia",
"status": "active",
"attachment": {
"file_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"file_name": "carrier-invoice.pdf",
"file_url": "https://media.dcycle.io/files/file-7c9e6679.pdf?X-Amz-Signature=..."
}
}
Common Errors
404 Not Found
Cause: The route does not exist or belongs to another organization (TRANSPORT_ROUTE_NOT_FOUND), or
attachment_file_id is not a file you can attach: unknown, outside your perimeter, pending, in the trash or private to
another organization all answer the same NOT_FOUND naming File.
422 Unprocessable Entity
Cause: The body has noattachment_file_id, it is not a UUID, or it carries another field.Was this page helpful?