Asynchronous Delete Content Library Folders API

This asynchronous API enables you to delete multiple content library folders in a single request. 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/clFolders?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 folders to delete.

Sample Request Body:

{
  "paths": [
    "/contentlibrary/folder",
    "/contentlibrary/folder1"
  ]
}

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": "OUZkeTFlOjoxNTY1NzAxNjY0",
  "apiName": "asyncDeleteMultipleContentLibraryFolders",
  "status": "REQUEST_ACCEPTED",
  "links": [
    {
      "rel": "self",
      "href": "/rest/asyncApi/v1.3/clFolders?action=delete",
      "method": "POST"
    },
    {
      "rel": "asyncResponse",
      "href": "/rest/asyncApi/v1.3/requests/OUZkeTFlOjoxNTY1NzAxNjY0",
      "method": "GET"
    }
  ]
}

Sample Error Responses

Empty list. Requests fail when there is an empty list in the request body. Error resembles:

{
  "type": "",
  "title": "Invalid request content",
  "errorCode": "INVALID_REQUEST_CONTENT",
  "detail": "Folder paths should not be empty. ",
  "errorDetails": []
}

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

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

Folder not found. The following example shows a sample error response for the Polling API endpoint – in this case, the paths object contains the error JSON, which tells us that the content library folders we tried to delete, did not exist. A response code of 200 OK is shown, however, because the polling request itself completed successfully.

{
  "response": {
    "paths": [
      "Deletion Failed: /contentlibrary/path1. FolderFault|FOLDER_NOT_FOUND|/contentlibrary/path1",
      "Deletion Failed: /contentlibrary/clPath2. FolderFault|FOLDER_NOT_FOUND|/contentlibrary/clPath2"
    ]
  },
  "requestId": "OUZkeTFlOjoxNTY1NzAxNjY0",
  "apiName": "asyncDeleteMultipleContentLibraryFolders",
  "timeZone": "India Standard Time",
  "requestTime": "2019-08-13T18:37:44.673",
  "requestProcessedTime": "2019-08-13T18:37:45.517",
  "status": "SUCCESS"
}

Duplicate folders. The following example shows a sample error response for the Polling API endpoint – in this case, the request body contains duplicate folders. A response code of 200 OK is shown, however, because the polling request itself completed successfully.

{
  "response": {
    "paths": [
      "contentlibrary/cl1",
      "Duplicate folder path [contentlibrary/cl1].",
      "Duplicate folder path [contentlibrary/cl1]."
    ]
  },
  "requestId": "UFBjUERNOjoxNTU2MjY5MDM2",
  "apiName": "asyncDeleteMultipleContentLibraryFolders",
  "timeZone": "India Standard Time",
  "requestTime": "2019-04-26T14:27:16.377",
  "requestProcessedTime": "2019-04-26T14:27:16.917",
  "status": "SUCCESS"
}

Learn more

Common error responses for the Asynchronous API

Delete content library folder