Download a document attached to a shipment
How to download a document from a shipment
You can download documents using two methods:
If the webhook shipment
documentcontains anobjectId: Download the supplier's document from the Tradecloud object-storage using theobjectIdanddownloadUrl.If the webhook shipment
documentcontains anurl: Download the document from the supplier's content server.
Method 1. Download the document from the Tradecloud object-storage
Step 1. Retrieve the objectId from the document
objectId from the documentPlease 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:
Step. 2. Retrieve the downloadUrl from the object storage
downloadUrl from the object storageGet document metadata
GET https://api.accp.tradecloud1.com/v2/object-storage/document/{objectId}/metadata
Path Parameters
objectId
string
document objectId
Headers
Authorization
string
Bearer Access-Token
Step 3. Download the document using the downloadUrl
downloadUrlJust GET the downloadUrl
This Amazon AWS S3 presigned url will expire within 1 minute.
Method 2. Download the document from the supplier content server
Step 1. Retrieve the url from the document
url from the documentPlease check the documents fields in:
In this example the url is:
Step 2. Download the document using the url
urlJust GET the url
Last updated