The CSObjects library includes all of the functionality available in the currently published Java API, with the exception of form rendering (which is provided by the Forms Service worker).
When invoking the iCM API Worker using the apiclient library, the method called will be the CSObjects class, with the method of that class appended to it with an underscore. For example, to invoke the CSArticle get method, use
The parameters map supplied to the method call should contain two sub-keys:
set the properties (and their values) which should be set before the specified method is performed.get a string that lists the properties whose values should be returned, or alternatively an asterisk to indicate that all properties should be returned.
Standard Methods
The following request retrieves just the article heading for article ID 1.
function(params, credentials) {
let getArticle = this.callWorkerMethod("icmapi", "CSArticle_get", {
"get": "ArticleHeading",
"set": {
"ArticleID": 1
}
});
return getArticle;
}
Note the use of
Non-Standard Methods
When calling a method that is not one of the standard operations (get, update, exist, delete), the iCM API worker first creates an API object and populates it with the contents of the set element of the request and then performs a get. This means that the operation method can be invoked on a populated object.
Any arguments to the non-standard method should be provided by an additional
function(params, credentials) {
let result = this.callWorkerMethod("icmapi", "CSObjectMultiple_generateXMLDocAsString", {
"get": "",
"set": {
"ObjectList": 1
},
"args": ["INFO"]
});
return result;
}