Attach Files
This endpoint allows you to attach a file (such as an image or PDF) to an existing cargo record in the Spectre Cloud.
<AttachFile>
Request
Endpoint
POSThttps://spectre-licensing.com/api/Cargo/AttachFile
Header
Content-Type:
multipart/form-data
Parameters
The following form parameters are required:
file
- The file to upload (must be provided as a form file)cargoID
- The ID of the cargo record to attach the file to
Authentication
Standard cloud authentication options
Response
Successful Response
{
"status": "Uploaded picture successfully",
"cargoID": 12345,
"error": null
}
Error Response
{
"status": null,
"cargoID": 0,
"error": "Error message details"
}
Common error messages:
Missing credentials
- Authentication information not providedInvalid login key
- The provided LoginKey is not validMissing file
- No file was uploaded in the requestMissing Cargo ID
- The cargoID parameter was not providedCargo Record Not Found
- No cargo record exists with the specified IDFailed to upload file to BLOB storage
- Issue with the storage system
Example Usage
Uploading a Picture
POST https://spectre-licensing.com/api/Cargo/AttachFile
Headers:
Content-Type: multipart/form-data
LoginKey: your_api_key_here
Form Data:
file: [image.jpg file data]
cargoID: 12345
Uploading a Freight Report
POST https://spectre-licensing.com/api/Cargo/AttachFile
Headers:
Content-Type: multipart/form-data
Form Data:
file: [report.pdf file data]
cargoID: 12345
Email: email
Password: password