Update content of images in a Content Library Document

post

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

Request

Path Parameters
Body ()
Request Body
Root Schema : Content Library Document Images
Type: object
Title: Content Library Document Images
Show Source
Nested Schema : imageData
Type: array
Images in the content library document.
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

Default Response

Body ()
Root Schema : Content Library Document Images
Type: object
Title: Content Library Document Images
Show Source
Nested Schema : imageData
Type: array
Images in the content library document.
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Examples

The following example shows how to update images in a content library document.

A successful request requires the following headers:

FIELDS DESCRIPTION
Authorization <AUTH_TOKEN>
Content-Type application/json

Required Body Parameters

  • documentPath (string) : The complete path of the document, starting with /contentlibrary.
  • imageData (array) : Images in the content library document. Contains itemData and itemPath for each image in the document.
  • itemPath (string) : Name of the image in the content library document.
  • itemData (string - byte) : Base64 encoded binary string of the image content.

Sample Request Body:

        {
    "documentPath" : "/contentlibrary/abn/wsrest_cl.htm",
    "imageData": [
      {
        "itemPath": "testcreate.png",
        "itemData": "<base64 encoded binary string>"
      }
      ]
    }
  
RESPONSE NOTES:
  • A success response echoes back the document path you sent, and it returns content as null. It also returns the related endpoints for the given document path.
  • 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.

Sample Response:Success

    {
       "documentPath": "/contentlibrary/abn/wsrest_cl.htm",
       "content": null,
       "links":    [
                {
             "rel": "self",
             "href": "/rest/api/v1.3/clDocImages/contentlibrary/abn/wsrest_cl.htm",
             "method": "POST"
          },
                {
             "rel": "getDocumentImages",
             "href": "/rest/api/v1.3/clDocImages/contentlibrary/abn/wsrest_cl.htm",
             "method": "GET"
          }
       ]
    }
	

Sample Response: Failure

    {
       "type": "",
       "title": "Invalid request parameters",
       "errorCode": "INVALID_PARAMETER",
       "detail": "Document Path in the URI does not match Document Path in the request payload",
       "errorDetails": []
    }
     
Back to Top