Set images in a content library document
Use this interface to set images in a content library document.
Service URL:
/rest/api/v1.3/clDocImages/{documentPath}
Required Path Parameter:
documentPath
Request Method:
POST
Request Header:
Authorization=<AUTH_TOKEN>
Content-Type=application/json
Request 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 JSON 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 in case of 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 in case of 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": []
}