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.
Any user with the relevant permissions can use the end points provided by the REST API to do the
following actions:
- Retrieve the decision services of your repository, their branches, deployment configurations, and test suites.
- Retrieve the list of servers available.
- Build, download, or deploy a RuleApp for a deployment configuration.
- Run a test suite.
- Delete test reports.
- Import and export decision services.
- Create snapshots of decision services.
curl https://<vhostname>.automationcloud.ibm.com/decisioncenter-api/v1/decisionservices --user username@company_name.com:passwordThis 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.
Accessing the REST API tool
You can access the Swagger user interface at https://<vhostname>.bpm.ibmcloud.com/odm/dev/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 authenticate by
using basic authentication, with your Decision Center user name and password. For
example:
curl https://<vhostname>.bpm.ibmcloud.com/odm/dev/decisioncenter-api/v1/decisionservices --user username@company_name.com:passwordNote: In
the Swagger user interface, you might see a
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 already logged in,
you do not need to authenticate again, and you can disregard this warning.
As an alternative, you can use service credentials to authenticate to the application.
Attention: If you change your cloud user role, or create a new set of service
credentials, the Decision Center
REST API is temporarily unavailable, and becomes available again after a maximum of 5
minutes.
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 https://<vhostname>.bpm.ibmcloud.com/odm/dev/decisioncenter-api/v1/decisionservices?page=2&size=20 --user username@company_name.com:passwordYou can also filter returned objects by their property, by using the
q
parameter:
curl https://<vhostname>.bpm.ibmcloud.com/odm/dev/decisioncenter-api/v1/decisionservices?q=name:AutoQuote --user username@company_name.com:password