Create a Content Library Media File
post
/rest/api/v1.3/clItems
This operation is used to create a content library media file.
Request
Request Body
Root Schema : Content Library Media Files
Type:
object
Title:
Show Source
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.
Response
Supported Media Types
- application/json
Default Response
Root Schema : Content Library Media Files
Type:
object
Title:
Show Source
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 content library media file in a content library folder.
A successful request requires the following headers:
FIELDS | DESCRIPTION |
---|---|
Authorization | <AUTH_TOKEN> |
Content-Type | application/json |
Sample Request Body:
REQUEST NOTE: Ensure that the itemData
value is a base64-encoded binary string with no extraneous hidden characters. When the itemData
value contains hidden characters, such as such as carriage returns or line feeds, the response returns an HTTP code of 500 and the error details return only an ID number.
{ "itemPath": "/contentlibrary/abn/testcreate_50.png", "itemData": "<base64 encoded binary string>" }
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/testcreate_50.png", "itemData": null, "links": [ { "rel": "self", "href": "/rest/api/v1.3/clItems", "method": "POST" }, { "rel": "getContentLibraryItem", "href": "/rest/api/v1.3/clItems/contentlibrary/abn/testcreate_50.png", "method": "GET" }, { "rel": "deleteContentLibraryItem", "href": "/rest/api/v1.3/clItems/contentlibrary/abn/testcreate_50.png", "method": "DELETE" }, { "rel": "setContentLibraryItem", "href": "/rest/api/v1.3/clItems/contentlibrary/abn/testcreate_50.png", "method": "POST" } ] }
Sample Response: Failure
{ "type": "", "title": "Document already exists", "errorCode": "DOCUMENT_ALREADY_EXISTS", "detail": "/contentlibrary/abn/testcreate_50.png", "errorDetails": [] }