Asynchronous Delete Content Library Items API

This asynchronous API enables you to delete multiple content library items in a single request (up to a maximum of 200 content library items). Use the Polling API endpoint to retrieve data about your request.

Note: The Asynchronous API is generally available for all Responsys customers.

Service URL:

/rest/asyncApi/v1.3/clitems?action=delete

Query Parameters:

action - Name of the action to perform. Must be set to delete.

Request Method:

POST

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Request Body - Required Properties:

paths - A list of content library items to delete (200 maximum).

Sample Request Body:

{
  "paths": [
    "/contentlibrary/item.htm",
    "/contentlibrary/item1.htm"
  ]
}

Response Notes:

  • The system validates the request payload syntax to ensure that the payload is well-formed JSON. However, it does not validate correctness of the values. For example, it does not validate if the campaign object exists or not, nor does it validate whether the payload uses the correct property names. Subsequently, you must poll for results to learn whether the request succeeded or failed due to other reasons.
  • A successful response for the asynchronous API returns an HTTPS status code of 202 Accepted.
  • The response body contains the information you need to analyze the response that you would get from the Polling API.
    • requestId: Unique identifier of the API request. The value is alphanumeric.
    • apiName: Name of the API request that you triggered. Always asyncMergeTriggerEmail for this API request’s response.
    • status: When successful, the status value is REQUEST_ACCEPTED. This means that the payload syntax was well-formed JSON and that the request was placed in the system queue for processing. You must poll for the final result; for more information, see Polling API endpoint.
  • See Common error responses for the Asynchronous API for details about the error responses.

Sample Successful Response:

{
  "requestId": "SXc4V092OjoxNjA2NzE4OTc4",
  "apiName": "asyncDeleteMultipleContentLibraryItems",
  "status": "REQUEST_ACCEPTED",
  "links": [
    {
      "rel": "self",
      "href": "/rest/asyncApi/v1.3/clItems?action=delete",
      "method": "POST"
    },
    {
      "rel": "asyncResponse",
      "href": "/rest/asyncApi/v1.3/requests/SXc4V092OjoxNjA2NzE4OTc4",
      "method": "GET"
    }
  ]
}

Sample Error Responses

Non content library items. Requests fail when non-content library items are passed in the request body. Error from the polling endpoint resembles:

{
  "response": {
    "paths": [
      "Path: /contentlibrary/folder/item1.htm does not exist.",
      "Path: /contentlibrary/folder/item2.htm does not exist.",
      "Path: /contentlibrary/folder/item3.htm does not exist."
    ]
  },
  "requestId": "ZklQV2tHOjoxNjA2NzIwODM2",
  "apiName": "asyncDeleteMultipleContentLibraryItems",
  "timeZone": "India Standard Time",
  "requestTime": "2020-11-30T12:50:36.232",
  "requestProcessedTime": "2020-11-30T12:50:37.416",
  "status": "SUCCESS"
}

Duplicate content library items. Requests fail when duplicate content library items are passed in the request body. Error resembles:

"response": {
  "paths": [
    "/contentlibrary/item1.htm",
    "Duplicate content library item path [/contentlibrary/item1.htm].",
    "Path: /contentlibrary/item2.htm does not exist.",
    "/contentlibrary/item2.htm",
    "Duplicate content library item path [/contentlibrary/item2.htm].",
    "Path: /contentlibrary/item2.htm does not exist."
  ]
}

Limit exceeded. The maximum number of content library items that can be deleted per request is 200. If more than 200 items are specified in one request, the following error appears:

{
  "type": "",
  "title": "Record limit exceeded",
  "errorCode": "RECORD_LIMIT_EXCEEDED",
  "detail": "Maximum 200 Items can be deleted.",
  "errorDetails": []
}

Learn more

Common error responses for the Asynchronous API

Delete content library folder