Task 1: Exploring the REST API tool

In this task, you start the REST API tool and look at its controllers. You use one of the controllers to obtain system, product, and database information.

About this task

The REST API tool contains a group of controllers. Each controller provides a set of operations for managing decision services. In this task, you start the sample server and open the REST API tool. Then, you run the about operation in the Public Controller to gather system, product, and database information.

Step 1: Opening the REST API tool

In this step, you start the sample server, and then open the REST API tool.

Procedure

  1. Start the sample server (see Starting the sample server).
  2. Open the REST API tool by using one of the following methods:
    • On all platforms, you can start the REST API tool from the Samples Console:
      1. Open the Samples Console in Rule Designer (see Running samples from the Samples Console).
      2. Click Decision Center REST API tool in the Sample Server view.
    • On all platforms, you can open the REST API tool by using the following URL in a web browser:

      http://localhost:9090/decisioncenter-api/swagger-ui.html

    • On Windows 11, click Start > All Programs > <ODM> > Decision Center API Console.

    The REST API includes the following tools:

    • About: Gets system, product, and database information.
    • Admin: Manages the contents of the repository.
    • Build: Creates snapshots, and builds and deploys RuleApps. It also runs test suites on decision services.
    • DBAdmin: Contains tools for managing the repository, including file deletion.
    • Explore: Lists decision services, and details on rule artifacts.
    • Govern: Manages the governance artifacts such as activities, releases.
    • Interchange: Contains the endpoint for using interchange files (see Applying an interchange file).
    • Manage: Creates and controls user accounts, and manages settings for the component.

    You expand a controller by clicking its name. A list is displayed, and each row in the list describes an operation. The first word in the row gives the HTTP request type, for example, GET, POST, and DELETE. The color of the row depends on the HTTP request type. This tutorial goes through some of the basic operations.

Step 2: Authorizing the Authorization API

To use Authorization (apiKey), you must first authorize it in the REST API.

Procedure

To authorize the API:

  1. Navigate to http://localhost:9090/decisioncenter-api/swagger-ui.html External link opens a new window or tab.
  2. Click the Authorize button in the top right corner.
  3. Do one of the following options:
    Option 1: Authorization (apiKey) dialog
    1. Enter the appropriate token in the header value:
      • Basic: Basic <token>
      • Bearer: Bearer <token>
      • ZenApiKey: ZenApiKey <token>
    2. Click Authorize. A login dialog opens.
    Option 2: basic (http, Basic) dialog
    1. Enter your username and password.
    2. Click Authorize.

Step 3: Gathering system information

In this step, you use the Public Controller to gather system, product, and database information. The controller also displays status information on the REST API tool.

Procedure

  1. Click about in the title bar for the Public Controller.
    The controller opens and displays only one operation, which gathers system, product, and database information:
    Image shows the Public Controller about line.
  2. Click Get to open the about operation.
    The operation contains three main sections:
    • Response Class: Describes the response.
    • Parameter: Lists and describes the parameters.
    • Response Messages: Lists the HTTP status codes and their descriptions.
  3. Click the Try it out! button at the bottom of the about operation window.
    The operation runs, and its response shows the following parts, which you can hide by clicking Hide Response next to the Try it out! button:
    • Curl: The curl instructions that call the about operation
    • Request URL: The URL to call the about operation directly in your browser
    • Request Headers: The titles of different requests
    • Response Body: The full response
      Image shows the response.
    • Response Code: The HTTP response code. It shows 200 for a successful operation.
    • Response Headers: The titles of the different responses
  4. Click About to close the controller.

What to do next

In the next task, you build a decision service in the REST API tool.