Create content library media file

Use this interface to create a content library media file in a content library folder.

Service URL:

/rest/api/v1.3/clItems

Request Method:

POST

Request Header:

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 in case of success:

RESPONSE 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 in case of failure:

{
   "type": "",
   "title": "Document already exists",
   "errorCode": "DOCUMENT_ALREADY_EXISTS",
   "detail": "/contentlibrary/abn/testcreate_50.png",
   "errorDetails": []
}