POST method

The POST method obtains data from an external data source for item types of a specific class. You do not call this method directly. Instead, the EDS REST protocol calls this method automatically when workflow information or a content item is being added or modified.
When IBM Content Navigator calls the POST method, the request payload contains the current value for each property. The current value can be one of the following values:
  • The default value
  • The value persisted for the property in the repository
  • The working value that the user entered for the property

The response payload that the external data service returns includes changes to the properties that it manages. The service can modify attributes of properties in addition to modifying property values.

IBM Content Navigator then merges these changes with the base data in the repository and returns the data to IBM Content Navigator.

URI syntax

/type/{class name}
Path elements
Table 1. Path elements for the POST method
Name Type Description
{object type name} String The symbolic name of the class name or item type name that defines the property that is being updated.

Request content

{
   "repositoryId":"target_object_store_name",
   "objectId"   : "GUID_or_PID_of_item_that_is_being_edited",
   "requestMode" : "request_context",
   "externalDataIdentifier" : "identifier_for_the_service",

   "properties":
   [
   {
      "symbolicName" : "property_name",
      "value"        : current_value,
   }

   // More properties ...

   ],

   "clientContext":
   {
      "Key1":"Value1",
      "Key2":"Value2"
   }

}
Table 2. Request parameters for the POST method
Name Type Required? Description
repositoryId String Yes The symbolic name of the target external data store that contains the property data.
objectId String No The globally unique identifier (GUID) or persistent identifier (PID) that identifies the item that is being edited.
requestMode String Yes One of the following request modes that indicates the reason that the POST method is being called:
  • initialNewObject
  • initialExistingObject
  • inProgressChanges
  • finalNewObject
  • finalExistingObject
See Request modes for information about the request modes.
externalData
Identifier
String Yes A string that indicates the state of the data that was returned by the external data service. The request must include this identifier if the requestMode parameter is set to one of these values:
  • inProgressChanges
  • finalNewObject
  • finalExistingObject
properties Array Yes An array that contains values for the properties that are defined for the class or item type. For each property, the request contains the symbolic name and the property value.
clientContext Object No An object that is used to send information about the context of the client request to EDS when an IBM Content Navigator user adds a document or folder, edits the properties of a document or folder, creates a search, or uses a custom action that requires an EDS service. The object contains the following key-value pairs:
userid
The user ID for the user who is logged in to IBM Content Navigator.
locale
The locale of the browser that initiated this call to the external data service.
desktop
The desktop ID for the desktop that is in use.
action
The active action for the EDS request to change the properties of a document or folder:
  • addItem (Add a document or folder)
  • checkin (Check in a document or folder (IBM Content Manager)
  • editProperties (Edit the properties for a single document or folder, not in a viewer)
  • entryTemplateBuilder (Run the entry template builder to create an entry template for a document)
  • multiEditProperties (Edit the properties for multiple selected documents or folders)
  • viewEditProperties (Edit the properties for a document in a viewer)
  • workflow (Edit the properties of a workflow item)
  • Custom action name
clientIdentity
The type of client that is making the request:
  • navigatorWeb (IBM Content Navigator web client)
  • navigatorMobile (IBM Content Navigator mobile client)
  • navigatorOffice (IBM Content Navigator for Microsoft Office client)
  • Custom client name
build
The build number string for the client, for example, icn203.555.
The following key-value pairs, which were added in IBM Content Navigator, Version 2.0.3, support the ability to for EDS implementations to return a different response where an entry template is active.
objectStoreId (FileNet® P8)
String ID of the object store where the item is stored.
entryTemplateId (FileNet P8 and IBM Content Manager)
The active entry template IBM Content Navigator ID string.
entryTemplateName (FileNet P8 and IBM Content Manager)
The active entry template name string.
entryTemplateVsId (FileNet P8)
The active entry template version series ID string.
entryTemplateItemId (IBM Content Manager)
The active entry template item ID string.
If custom properties are set in the new ecm.model._HasAttributesMixin.retrieveDependentAttributeDefinitionsContext object, those custom properties are included as key-value pairs in the clientContext parameter.

IBM Content Navigator Version 2.0.3 or later copies the cookies from the client EDS request to the request that is sent to the EDS service. When the cookies include user credentials, such as an LTPA token, the EDS service is able to use those credentials to log in to an external system, such as the content server. However, when cookies do not include appropriate user credentials, you can implement a custom request filter that includes user credentials.

The following example shows the clientContext JSON object for an EDS request to add a document to a FileNet P8 repository by using an entry template that is named EDS Entry Template, where the request is from IBM Content Navigator web client with the build version of the initial release for IBM Content Navigator Version 2.0.3.


   "clientContext":
   {
      "entryTemplateName": "EDS Entry Template",
      "entryTemplateVsId": "{CA2D4029-D4BD-4FA9-83E2-E3CBE2022A46}",
      "entryTemplateId": "EntryTemplate,{7A4FC249-E366-4A71-9AA2-80342B44C783},{5AF14D3D-74B9-401D-BFD6-EA9F30A4167D}",
      "locale": "en_US",
      "action": "addItem",
      "userid": "myUserID",
      "desktop": "default",
      "clientIdentity": "navigatorWeb",
      "build": "icn203.555",
      "objectStoreId": "{7A4FC249-E366-4A71-9AA2-80342B44C783}"
   }

Response codes

Table 3. Response codes for the POST method
Code Description
200 OK The method completed successfully. The response that is returned by the POST method includes the updated information for the property.
400 Bad Request One of the required parameters was missing or a parameter value was invalid.
404 Not Found The class that was specified in the request was not found. This error does not indicate that the class is invalid. Instead, it indicates that the external data service does not manage any property values for the class. The EDS REST protocol does not return an error to IBM Content Navigator.
500 Internal Server Error A server error occurred. For information about the error, see the userMessage element in the JSON response.