Upload Files
POST v2/{modelType}/{modelID}/files
Uploads file: Use a multipart form. The file should be in the field 'file' and the description_id should be in the field description.
Description
Value
Rate Confirmation
1
Pickup Document (BOL)
2
Miscellaneous
3
The Endpoint
POST https://api.test.archer-app.com/v2/loads/999999/filesExamples
cURL
curl --request POST \
--url https://api.test.archer-app.com/v2/loads/999999/files \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--cookie 'auth-server-token=TOKEN;' \
--form file=confirmation.pdf \
--form description=1JavaScript
var data = new FormData();
data.append("file", "~/confirmation.pdf");
data.append("description", "1");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.test.archer-app.com/v2/loads/999999/files");
xhr.setRequestHeader("cookie", "auth-server-token=TOKEN;");
xhr.send(data);Body Object
None
ExampleBody
None
Response
Returns the file information.
Response Properties
Name
Type
Description
id
int
File Id.
modelType
string
Model name.
modelId
int
Model Id.
description
int
Description Id.
name
string
The file name.
Example Response
Example Error Response
When the User is trying to upload a file to an object that is not one of their own.
Last updated