Upload a new document and associated metadata
const url = 'https://api.tradecloud1.com/v2/object-storage/document';const form = new FormData();form.append('file', 'file');form.append('Content-Transfer-Encoding', 'binary');
const options = {method: 'POST', headers: {Authorization: '<Authorization>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradecloud1.com/v2/object-storage/document \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: multipart/form-data' \ --form file=@file \ --form Content-Transfer-Encoding=binaryDocuments are securely stored and only available to you and other parties like your supplier or buyer. Refer to our API manual for more information. Document uploads are limited to 500 MB. Requests will timeout after 60 seconds.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Mandatory name of the part of multipart request containing uploaded document data. If there are multiple parts with the same name, the first one will be used and the subsequent ones ignored
Optional header to indicate the encoding of the submitted file. Note that this is not a request header, but a formData part header.
By default, this header can be ommitted and the file in the formData will be interpreted as binary (a sequence of octets). In case you want to upload a file by means of a Base64-encoded string, set this header to base64
Responses
Section titled “Responses”AcknowledgeWithId containing newly uploaded document id
object
Example
{ "id": "00f03b98-2511-489f-9695-13791b3f66b6"}Request Entity Too Large. Returns if document size exceeds 500 MB
Unsupported Media Type. Verify that the file extension is not blacklisted.
Internal server error
