Get images in a content library document

Use this interface to get images in a content library document.

Service URL:

/rest/api/v1.3/clDocImages/{documentPath}

Required Path Parameter:

documentPath

Request Method:

GET

Request Header:

Authorization=<AUTH_TOKEN>

Request Body:

None

Response Notes:

  • A success response echoes back the document path requested, and it returns the path and Base64-encoded binary string content for each image in the document.
  • Possible error responses occur when:
    • The documentPath is incorrect in the request (error codes include FOLDER_NOT_FOUND and DOCUMENT_NOT_FOUND and the details show the folder path without the file name). Verify that the folder and file names are spelled correctly and that they exist in the Content Library. To get the correct path, you can ask the Responsys Account Admin to send you a copy of the document path, which the admin can get from the Content Library.
    • The documentPath has incorrect format in the request (error code is INVALID_PARAMETER and the details show the folder path without the file name). Verify that you have included /contentlibrary at the start of the path, have spelled it correctly, and have included the document file name at the end of the path.
    • The document in your request does not contain images, or the path to the image is broken (error code is IMAGES_NOT_FOUND). Verify that you are requesting the images for the correct Content Library file. You can also retrieve the HTML document from the content library and examine it to determine if there are errors in the image tags, such as the wrong file extension, file name, or path to the image file.

Sample Response in case of success:

{
   "documentPath": "/contentlibrary/abn/wsrest_cl.htm",
   "imageData": [   {
      "itemPath": "/contentlibrary/abn/testcreate.png",
      "itemData": "<base64 encoded binary string>",
      "links":       [
                  {
            "rel": "getContentLibraryItem",
            "href": "/rest/api/v1.3/clItems/contentlibrary/abn/testcreate.png",
            "method": "GET"
         },
                  {
            "rel": "setContentLibraryItem",
            "href": "/rest/api/v1.3/clItems/contentlibrary/abn/testcreate.png",
            "method": "POST"
         },
                  {
            "rel": "deleteContentLibraryItem",
            "href": "/rest/api/v1.3/clItems/contentlibrary/abn/testcreate.png",
            "method": "DELETE"
         },
                  {
            "rel": "createContentLibraryItem",
            "href": "/rest/api/v1.3/clItems",
            "method": "POST"
         }
      ]
   }],
   "links":    [
            {
         "rel": "self",
         "href": "/rest/api/v1.3/clDocImages/contentlibrary/abn/wsrest_cl.htm",
         "method": "GET"
      },
            {
         "rel": "setDocumentImages",
         "href": "/rest/api/v1.3/clDocImages/contentlibrary/abn/wsrest_cl.htm",
         "method": "POST"
      }
   ]
}

Sample Response in case of failure:

{
   "type": "",
   "title": "Images not found",
   "errorCode": "IMAGES_NOT_FOUND",
   "detail": "There are no images in wsrest_cl.htm",
   "errorDetails": []
}