Attachment Upload
The Attachment Upload API allows you to upload attachments to WMS. The attachment name along with the base 64 encoded attachment data needs to be sent in the options section of the request body. The API supports both entity by ID and entity by filters.
API
POST.../attachment/upload/
Parameters
Name | Required | Description |
---|---|---|
company_id | X | This is required for all entities |
facility_id | C | This is required only for facility level entities – Inbound LPN, Inbound Shipment, Outbound LPN, Outbound Load and Pallet. Not required for LPN Type |
entity | X | Represents the entity - IBLPN, IBSHIPMENT, OBLPN, LPNTYPE, OBLOAD, PALLET for which the request is being made. |
entity_id | O | Represents the unique ID of the entity, such as Container ID, IB Shipment ID. If entity_key is not populated, this field has to be populated |
entity_key | O | Represents the nbr or code of the entity such Container Nbr, Shipment Nbr, LPN Type Code. If entity_id is not populated, this field has to be populated |
Where X = Required; C = Conditional and O = Optional
Options:
- attachment_name (Required)
- attachment_data (Required) – Base 64 encoded. If using an online tool to encode your attachments to base 64, use output format as “Data URI”
Example Requests
Entity by ID
POST .../attachment/upload/
{
"parameters": {
"company_id": "369",
"facility_id": "648",
"entity": "IBLPN",
"entity_id": 12345 (container_id)
},
"options": {
"attachment_name": "file123.png",
"attachment_data": "data:@file/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/…" (base64 encoded)
}
}
Entity by Filters
POST .../attachment/upload/
{
"parameters": {
"company_id": "369",
"facility_id": "648",
"entity": "IBLPN",
"entity_key": "LPN123" (container_nbr)
},
"options": {
"attachment_name": "file123.docx",
"attachment_data": "data:@file/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQABgAIAGCnNFWaPJ7…" (base64 encoded)
}
}
Response
If the attachment is uploaded successfully, a 200 OK is returned with the following field in the response body.
{
"nbr_attachments": <Nbr of Attachments>
}
This field indicates the total number of attachments in WMS for the entity ID or entity key passed in the request.
Depending on the entity for which the attachment has been uploaded, the keys would be different as depicted in the table below:
Entity | Key | Note |
---|---|---|
IBLPN | Inbound LPN number | Mandatory – Every attachment will be tagged with this key |
Inbound shipment number | Optional – Attachments will be tagged with these keys only if available at the time of uploading | |
Purchase order number | ||
Trailer number | ||
Pallet number | ||
OBLPN | Outbound LPN number | Mandatory – Every attachment will be tagged with these keys |
Outbound order number | ||
Outbound load number | Optional – Attachments will be tagged with these keys only if available at the time of uploading | |
Pallet number | ||
LPNTYPE | LPN Type | Mandatory – Every attachment will be tagged with this key |
IBSHIPMENT | Inbound shipment number | Mandatory – Every attachment will be tagged with this key |
Purchase order number | Optional – Attachments will be tagged with these keys only if available at the time of uploading | |
Trailer number | ||
Inbound load number | Optional – Although optional, attachments will always be tagged with this key, since this data is always available | |
OBLOAD | Outbound load number | Mandatory – Every attachment will be tagged with this key |
Trailer number | Optional – Attachments will be tagged with this key only if available at the time of uploading | |
PALLET | Pallet number | Mandatory – Every attachment will be tagged with this key |