Oracle WebCenter Interaction Web Service Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using the Oracle WebCenter Interaction Directory REST API

To add a new document to a the portal Directory, send a POST request containing the necessary data to the portal URL.

The post must be of content-type “application/json” and use the following syntax:
POST http://host/portal/{FOLDER ID}

  "document": {
    "name": "NAME",
    "description": "DESCRIPTION",
    "datasourceid": "DATA SOURCE ID",
    "contenturl": "CONTENT URL"

For increased security, all JSON used in the API must be comment filtered. The JSON data should be wrapped in /* */ for any JSON, either in the API request or response. In addition, all JSON output will be wrapped in a plain { } block so that it can't be used directly in a script src tag.

Variable Description
FOLDER ID The ID of the Directory folder to access. The folder must already exist in the portal. If you do not know the folder ID, there are two ways to retrieve one:
NAME The name of the document to be displayed in the Directory.
DESCRIPTION The description of the document to be displayed in the Directory.
DATA SOURCE ID The Content Source ID for the document. The ID must be a valid Content Source configured in the portal. For example, the World Wide Web Content Source is ID 104.
CONTENT URL The full file path to the document.
Note: The Oracle WebCenter Interaction REST APIs are protected by Oracle WebCenter Interaction security. Access is restricted to portal users by login token verification or basic authentication. For details, see Configuring Web Services that Use Oracle WebCenter Interaction REST APIs.
The response will include one of the following HTTP codes:
  • 201 // object created
  • 1000 // GENERAL - Unable to process request.
  • 1010 // NOT_LOGGED_IN - The current user does not have access to this API.
  • 1020 // NOT_POST - This API only supports POSTs.
  • 1030 // NO_POST_CONTENT - No POST content found.
  • 1031 // NO_JSON_POST_CONTENT - JSON data not found in POST content.
  • 2000 // NO_JSON_DOCUMENT_OBJECT - Document node not in JSON document.
  • 2010 // NO_FOLDER_ID - The API URL did not contain the folder ID.
  • 2020 // NO_DATA_SOURCE_ID - The API data did not include a valid data source ID.
  • 2030 // NO_CONTENT_URL - The API data did not include a valid content source URL.
The response body includes the new object ID and the path to the folder and uses the following syntax:
  "document": {
    "name": "Document name",
    "objectid": "2143",
    "folderid": "1983",
    "folderpath": "\Knowledge Directory\test folder\submits"
To view a complete implementation of this API, see the Submit to Knowledge Directory portlet included with the Oracle WebCenter Interaction installation (in the image service under /plumtree/portal/private/kdsubmit/).

  Back to Top      Previous Next