Create a copy of a Content Library Media file.
/rest/api/v1.3/clItems/{destinationItemPath}
Request
-
destinationItemPath: string
The complete path of the media file starting with /contentlibrary.
object
copy content document Request
-
itemPath(optional):
string
Path of source item
Response
- application/json
Default Response
object
Content Library Media Files
-
itemData:
string
Base64 encoded binary string of the media file content.
-
itemPath:
string
The complete path of the media file starting with /contentlibrary.
Examples
This interface is used to create a copy of a content library media file.
A successful request requires the following headers:
FIELDS | DESCRIPTION |
---|---|
Authorization | <AUTH_TOKEN> |
Sample Request Body:
{ "itemPath" : <sourceItemPath> }
Sample Response : Success
Note: The "itemData" attribute in the response is returned as null always. This is done to avoid returning large binary content in the response.
{ "itemPath": "/contentlibrary/abn/copiedimage.png", "itemData": null, "links": [ { "rel": "self", "href": "/rest/api/v1.3/clItems/contentlibrary/abn/copiedimage.png", "method": "PUT" }, { "rel": "getContentLibraryItem", "href": "/rest/api/v1.3/clItems/contentlibrary/abn/copiedimage.png", "method": "GET" }, { "rel": "deleteContentLibraryItem", "href": "/rest/api/v1.3/clItems/contentlibrary/abn/copiedimage.png", "method": "DELETE" } ] }
Sample Response: Failure - Document Not Found
The system sends the following response when it cannot find the source folder or file or the destination folder:
{ "type": "", "title": "Document not found", "errorCode": "DOCUMENT_NOT_FOUND", "detail": "Document not found:/contentlibrary/abn/testcreate_50.png", "errorDetails": [] }
Sample Response: Failure - File Type Mismatch
For a request to copy a file named dinoSmall.jpg
(source file type JPEG) to /contentlibrary/jmptest/testdocs/copyDinoSmall2.png
(destination file type PNG), the system returns the following response:
{ "type": "", "title": "Invalid request parameters", "errorCode": "INVALID_PARAMETER", "detail": "Invalid destination :/contentlibrary/jmptest/testdocs/copyDinoSmall2.png", "errorDetails": [] }