To use the REST API tool, you select a resource type, you
click a method name, and you pass it the appropriate parameters. When
you call the method, the resulting request and response display immediately.
About this task
The REST API test tool is a web application that you can
use to test the management capabilities of the following REST resources
and their associated parameters:
- RuleApps
- Rulesets
- XOMs
- Libraries
- Decision Warehouse traces
- Utilities
Tip: You can get the
Rule Execution Server
console initialization information and
Rule Execution Server diagnostics in the
/utilities tab. For more information about the
diagnostic test, see
Diagnostic tests description
Procedure
- Sign in to the Rule Execution Server console
as an administrator and click the REST API tab
to display the test tool.
-
In the REST API tab, click the tab for the resource on which you want
to call methods: /ruleapps, /rulesets,
/libraries, /xoms,
/decisiontraces, and /utilities.
Rule Execution Server REST resources are RuleApps,
rulesets, XOM libraries, XOM resources, Decision Warehouse traces, and utilities.
- Click anywhere on either of the GET, POST, PUT,
or DELETE method paths.
This
action opens the panel that displays the request and response elements,
such as Request Body, URL Query Parameters, and HTTP
Header Parameters.
- Optional: Click Show Parameter Details to
consult a list of available parameters and their documentation.
You can also consult the REST API reference manual for details and examples
of the format that is used in requests and responses.
- Optional: Enter the body of the request when
applicable.
Some methods do not take a request body.
Table 1. Request Body
Methods |
Input format |
Resources |
POST and PUT methods |
For the methods that require a request body,
the request body uses one of the following formats:
- An XML or JSON description of the object
- A binary file, which makes the parameter mandatory: until you
select a file, a warning icon is displayed.
- A value in a plain-text field, such as a property value
|
For RuleApp and ruleset resources, you must
pass a valid ruleset archive in one of two ways:
- You encode an existing ruleset in Base64 and add the resulting
code to the XML or JSON code.
- You leave the bytecode provided in the
<archive></archive> XML
tag pair or in the JSON "archive" tag of the Request
Body. This bytecode composes a valid ruleset archive with no rules,
no rule flow, no parameters. You can later update this empty ruleset
archive with a real ruleset archive.
|
- Select the appropriate parameter boxes and then add values
from the drop-down menus.
Note: Tooltips indicate mandatory or read-only parameters. The parameter is not editable: its check
box is automatically selected and you cannot clear it. If no default value is predefined for a
mandatory parameter, a warning icon is displayed and the Call method button
remains disabled until you specify a value. Read-only parameters are mandatory.
Use
the following table to parameterize your request:
Table 2. Parameters
Methods |
Parameters |
Parameter templates |
All |
The Accept parameter
has two predefined values. If you try to enter other values manually,
an HTTP Status 406 Not Acceptable warning is displayed.
Some
methods take parameters for which you can add your own custom values
to the predefined values.
|
Parameter templates, which are displayed between
curled brackets ({}) in the calling URLs, are placeholders. You must
specify a value for them because they are mandatory. |
GET |
In some GET methods, no parameters are selected
because they are all optional. In this case, you can click Call
method directly. |
|
- Click Call method.
A
panel opens and displays the request and its response.