Download a document attached to an order response
How to download a document from an order or line response
You can download documents using two methods:
- 1.If the webhook order or line
document
contains anobjectId
: Download the supplier's document from the Tradecloud object-storage using theobjectId
anddownloadUrl
- 2.If the webhook order or line
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": "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-483e360b833b
Apply the
objectId
in the GET document metadata end point to retrieve the downloadUrl
from the object storage.Just GET the
downloadUrl
This Amazon AWS S3 presigned url will expire within 1 minute.
"documents": [
{
"code": "123456789",
"revision": "B",
"name": "Tradecloud API Manual",
"url": "http://supplier.com/content/manual.pdf",
"type": "General",
"description": "General document"
}
],
Please check the
documents
fields in:In this example the
url
is:http://supplier.com/content/manual.pdf
Just GET the
url
Last modified 20d ago