Download a document attached to a shipment
How to download a document from a shipment
You can download documents using two methods:
- 1.If the webhook shipment
document
contains anobjectId
: Download the supplier's document from the Tradecloud object-storage using theobjectId
anddownloadUrl
. - 2.If the webhook shipment
document
contains anurl
: Download the document from the supplier's content server.
If both
objectId
and url
are missing in the document
, no file is available for download.Please check the
documents
fields in:"documents": [
{
"code": "10007563",
"revision": "B",
"name": "Tradecloud API Manual",
"description": "General document",
"type": "General",
"objectId": "05d251f0-0166-4e1e-8110-8d7a507b18f4",
"meta": {
"lastUpdatedAt": "2019-12-31T10:11:12"
}
}
],
In this example the
objectId
is:05d251f0-0166-4e1e-8110-8d7a507b18f4
get
https://api.accp.tradecloud1.com/v2
/object-storage/document/{objectId}/metadata
Get document metadata
Just GET the
downloadUrl
This Amazon AWS S3 presigned url will expire within 1 minute.
"documents": [
{
"code": "10007563",
"revision": "B",
"name": "Tradecloud API Manual",
"description": "General document",
"type": "General",
"url": "http://supplier.com/content/manual.pdf",
"meta": {
"lastUpdatedAt": "2019-12-31T10:11:12"
}
}
],
Please check the
documents
fields in:In this example the
url
is:http://supplier.com/content/manual.pdf
Just GET the
url
Last modified 1yr ago