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.
- Attachment upload through this API is only allowed if the requesting user
belongs to the group with upload permission for the requested entity and the
entity is in a valid status:
- If entity is IBLPN, the requesting user should have “container / Upload Files” permission AND the LPN should not be cancelled, consumed or lost.
- If entity is OBLPN, the requesting user should have “container / Upload Files” permission AND the LPN should not be cancelled, shipped or delivered.
- If entity is LPNTYPE, the requesting user should have “LPN Type / Upload Files” permission.
- If entity is IBSHIPMENT, the requesting user should have “ib shipment / Upload Files” permission AND the IB Shipment should not be cancelled.
- If entity is OBLOAD, the requesting user should have “load / Upload Files” permission AND the OB Load should not be cancelled.
- If entity is PALLET, the requesting user should have “Pallet / Upload Files” permission AND the Pallet should not be cancelled.
- Only one attachment can be uploaded per request.
- The size of attachment is limited to 10 MB.
- Attachments are subjected to virus scanning.
- Attachments of the following file types are supported: jpg, jpeg, png, doc, docx, xls, xlsx, pdf.
Each attachment uploaded to WMS is tagged with relevant keys that can be used as a search criterion in the Attachments UI in WMS.
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 |