Overview

Decision Center exposes a REST API that you can use to build, test, and deploy decision services. With this REST API, you can easily set up and enforce a continuous deployment process by using the programming language of your choice.

You can use the end points provided by the REST API to carry out your tasks, such as:
  • Retrieve the decision services of your repository, their branches, deployment configurations, and test suites.
  • Delete individual decision services in your repository.
  • Retrieve the list of servers available.
  • Retrieve, import, and export group permissions.
  • Build, download, or deploy a RuleApp for a deployment configuration.
  • Run a test suite.
  • Import and export decision services.
  • Manage decision services that use the decision governance framework.
  • View the contents of your repository.

Restrictions based on user roles and permissions also apply to the Decision Center REST API. See Decision Center groups of users.

For example, use the following command:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices --user rtsAdmin:rtsAdmin
This command returns a JSON object such as:
{
  "elements": [
    {
      "id": "77072920-2ec3-11db-bb3d-a34db576b043",
      "internalId": "brm.RuleProject:1:1",
      "name": "miniloan-rules",
      "buildMode": "DecisionEngine"
    },
    {
      "id": "4d9b5dc7-8a7e-404d-a05d-59023707c7d9",
      "internalId": "brm.RuleProject:2:2",
      "name": "AutoQuote",
      "buildMode": "DecisionEngine"
    }
  ],
  "totalCount": 2,
  "number": 0,
  "size": 2
}
Note: Sanitize data received from the REST API before displaying it in your web application to prevent potential cross-site scripting vulnerabilities.

Packaging and deployment

On Liberty profile and Tomcat application servers, the REST API is bundled as a stand-alone web application (WAR file) that can be deployed independently from the Business console. For more information, see Deploying the Decision Center WAR files on Liberty profile, or Deploying the Decision Center WAR files on Tomcat.

If you are using another application server, the REST API is deployed when the Decision Center EAR file is deployed.

This web application is completely stateless and can be deployed behind a load balancer for scalability and reliability purposes, without any session affinity. When it is deployed, you can access the Swagger user interface at http://localhost:<port_number>/decisioncenter-api. This interface exposes a view of the available endpoints, their documentation, and a Try it out button to test each endpoint.

Authentication

All endpoints, except /about, require authentication. You can use basic authentication by entering your Decision Center user name and password. For example:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices --user rtsAdmin:rtsAdmin
Tip: In the Swagger user interface, you might see a Image shows warning icon warning icon in some of the REST API methods. When you click this warning, a window opens asking for your login credentials. If you are authenticated to the server, you do not need to authenticate again, and you can disregard this warning.

Errors

Conventional HTTP response codes are used to indicate the success or failure of an API request. When an error occurs, the body of the HTTP response always contains a JSON error object with an error code, a reason, and a reference. For example:
{
  "error": "IlrConnectException",
  "reason": "Could not look up data source named 'mydatasource'",
  "status": "BAD_REQUEST",
  "details": [
    "Could not look up data source named 'mydatasource'",
    "Name [mydatasource] is not bound in this Context. Unable to find [mydatasource]."
  ]
}

Filtering and pagination

Explore methods that return collections of objects, such as /decisionservices, can be paginated. By default, all elements of the collection are returned, but you can specify a page size and a page number to retrieve only a subset of the collection. For example:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices?page=2&size=20 --user rtsAdmin:rtsAdmin
You can also filter returned objects by their property, by using the q parameter:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices?q=name:AutoQuote --user rtsAdmin:rtsAdmin