skip to main content
Corticon Server: Integration & Deployment Guide : Invoking Corticon Server : REST call
 

Try Corticon Now

REST call

Corticon supplies a REST API that lets client applications execute against remote Decision Service. The endpoint to this REST API is:
http://<base>/axis/corticon
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.

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 status and header are, for example:
200 The Decision Service executed
{
"date": "Thu, 07 Jun 2018 19:50:52 GMT",
"content-encoding": "gzip",
"vary": "Accept-Encoding",
"server": "Apache-Coyote/1.1",
"transfer-encoding": "chunked",
"content-type": "application/json"
}

Common error behavior

For all REST executions, there is a common error behavior. The error response has an HTTP status code other than 200, and a user-friendly error message in the header. For example:
400 Bad Request

{
"date": "Thu, 07 Jun 2018 19:56:48 GMT",
"server": "Apache-Coyote/1.1",
"connection": "close",
"error": "CcServer.lookupCcServerPoolForExecution() Decision Service: ProcessedOrder is not registered. Update failed. (Missing pool manager)",
"content-length": "0",
"content-type": null
}