Download a document attached to an order
How to download a document from an order or line
You can download documents using two methods:
If the webhook order or line
documentcontains anobjectId: Download the buyer's document from the Tradecloud object-storage using theobjectIdanddownloadUrlIf the webhook order or line
documentcontains anurl: Download the document from the buyer's content server.
If both objectId and url are missing in the document, no file is available for download.
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 order and lines in:
"documents": [
{
"code": "123456789",
"revision": "B",
"name": "Tradecloud API Manual",
"objectId": "67aa8ece-5d41-496f-a94c-483e360b833b",
"type": "General",
"description": "General document"
}
],In this example the objectId is:
67aa8ece-5d41-496f-a94c-483e360b833bStep. 2. Retrieve the downloadUrl from the object storage
downloadUrl from the object storageApply the objectId in the GET document metadata endpoint to retrieve the downloadUrl from the object storage.
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 order and lines in:
"documents": [
{
"code": "123456789",
"revision": "B",
"name": "Tradecloud API Manual",
"url": "http://buyer.com/content/manual.pdf",
"type": "General",
"description": "General document"
}
],In this example the url is:
http://buyer.com/content/manual.pdfStep 2. Download the document using the url
urlJust GET the url
Last updated