Create a Content Library Document
post
/rest/api/v1.3/clDocs
Request
Request Body
Root Schema : Content Library Documents
Type:
object
Title:
Show Source
Content Library Documents
-
content:
string
Document content.
-
docPath:
string
The complete path of the document starting with '/contentlibrary'.
Response
Supported Media Types
- application/json
Default Response
Root Schema : Content Library Documents
Type:
object
Title:
Show Source
Content Library Documents
-
content:
string
Document content.
-
docPath:
string
The complete path of the document starting with '/contentlibrary'.
Examples
This interface is used to create a content library document.
A successful request requires the following headers:
FIELDS | DESCRIPTION |
---|---|
Authorization | <AUTH_TOKEN> |
Content-Type | application/json |
Sample Request Body:
NOTE: The REST API will support ONLY UTF-8 character encoding. Special characters in the document content need to be UTF-8 encoded. If that is not the case, an error response is given.
{ "documentPath": "/contentlibrary/abn/wsrest_cl.htm", "content": "<html dir=\"ltr\">\r\n <head>\r\n <title><\/title>\r\n <\/head>\r\n <body>\r\n <p>test document<\/p>\r\n <p><img src=\"wsrest_cl.images/testcreate-1.png\" alt=\"\" /><\/p>\r\n <\/body>\r\n<\/html>\n\n" }
Sample Response :Success
NOTE: Content Library saves files with ".html" extension with a " .htm" extension. Therefore the response will have links to the document with a " .htm" extension
{ "documentPath": "/contentlibrary/abn/wsrest_cl.htm", "content": null, "links": [ { "rel": "self", "href": "/rest/api/v1.3/clDocs", "method": "POST" }, { "rel": "getDocumentContent", "href": "/rest/api/v1.3/clDocs/contentlibrary/abn/wsrest_cl.htm", "method": "GET" }, { "rel": "deleteDocument", "href": "/rest/api/v1.3/clDocs/contentlibrary/abn/wsrest_cl.htm", "method": "DELETE" }, { "rel": "setDocumentContent", "href": "/rest/api/v1.3/clDocs/contentlibrary/abn/wsrest_cl.htm", "method": "POST" } ] }
Sample Response: Failure
{ "type": "", "title": "Document already exists", "errorCode": "DOCUMENT_ALREADY_EXISTS", "detail": "/contentlibrary/abn/wsrest_cl.htm", "errorDetails": [] }