REST call
- Last Updated: March 24, 2022
- 2 minute read
- Corticon
- Version 6.3
- Documentation
Corticon supplies a REST API that lets client applications execute against remote Decision Services. The endpoint to this REST API is:
http://<base>/axis/corticon/execute
where <base> is the Corticon
Server's IP or DNS-resolvable name and port.
The payload set to the REST API is a JSON object that contains the Decision Service and related data to execute against. The format of the JSON object is:
{
"name": <string>,
"majorVersion":<number - optional>,
"minorVersion": <number - optional>,
"Objects": <JSONArray of JSONObjects>
}
where name, majorVersion, and minorVersion values
specify which Decision Service will be used for the execution, and the Objects value is the payload of the data to be
processed.
HTTP
POST in the form:
HTTP POST:base/axis/corticon/executewhere
base is the Corticon Server's IP or DNS-resolvable name and
port. For example:{
"name": "ProcessOrder",
"majorVersion":"1",
"minorVersion": "16",
"Objects": <JSONArray of JSONObjects>
}
Success and error responses
The response returned by the server has two parts:- A HTTP status code
- An HTTP header containing message execution info
Success response - In addition to the processed request, when execution is successful, the response message's body contains the updated JSON string. A successful execution's shows its status (200) and header.
Error behavior
For all REST executions, an error (an HTTP status code other than 200) provides messages in the response body.
Example:
{"error": {
"type": "com.corticon.eclipse.rest.delegates.CcRestDelegateRequestErrorException",
"message": "retrieveServiceProperties(String,String,String)
Could not find decision service: \"Process Order \"",
"cause":{
"stackTrace": [...],
"type": "com.corticon.service.ccserver.exception.CcServerDecisionServiceNotRegisteredException",
"message": "CcServer.lookupCcServerPoolHighestVersionNumber()
Decision Service: Process Order is not registered. Update failed."},
"stackTrace": [...],"parentError": {"stackTrace": [...],
"type": "com.corticon.service.ccserver.exception.CcServerDecisionServiceNotRegisteredException",
"message": "CcServer.lookupCcServerPoolHighestVersionNumber()
Decision Service: Process Order is not registered. Update failed."}}}