Attachment Delete

The Attachment Delete API allows you to delete attachments from WMS. The list of attachment IDs needs to be sent in the options section of the request body. The attachment ID is internal to WMS and can be retrieved using the “attachment/get” API described in the Attachment Get section. The API supports both entity by ID and entity by filters.

API

POST.../attachment/delete/

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 ID list (Required)

Example Requests

Entity by ID

POST .../attachment/delete/
{
  "parameters": {
    "company_id": "369",
    "facility_id": "648",
    "entity": "IBLPN",
    "entity_id": 12345 (container_id)
    },
    "options": {
        "attachment_id_list": [
	 1230,
	 2457,
        7299
      ]
    }
}

Entity by Filters

POST .../attachment/delete/
{
  "parameters": {
    "company_id": "369",
    "facility_id": "648",
      "entity": "IBLPN",
      "entity_key": "LPN123" (container_nbr)
      },
    "options": {
        "attachment_id_list": [
	 1230,
	 2457,
        7299
      ]
    }
}

Response

Depending on how many attachments are deleted successfully, a 200 OK is returned with the following field in the response body.

{
"nbr_deleted": <Nbr of attachments deleted successfully>,
"nbr_failed": <Nbr of attachments that could not be deleted>,
"nbr_attachments": <Nbr of Attachments> 
}

Where nbr_deleted indicates the number of attachments that were successfully deleted from WMS.

  • nbr_failed indicates the number of attachments that could not be deleted from WMS.
  • nbr_attachments indicate the remaining number of attachments in WMS for the entity ID or entity key passed in the request.
Note:
  • Attachment delete through this API is only allowed if the requesting user belongs to the group with delete permission for the requested entity:
    • If entity is IBLPN or OBLPN, the requesting user should have "container / Delete Files" permission.
    • If entity is LPNTYPE, the requesting user should have "LPN Type / Delete Files" permission.
    • If entity is IBSHIPMENT, the requesting user should have "ib shipment / Delete Files" permission.
    • If entity is OBLOAD, the requesting user should have "load / Delete Files" permission.
    • If entity is PALLET, the requesting user should have "Pallet / Delete Files" permission.