Accessing the REST API

You can use the REST API by entering its URL in a browser window and entering your credentials.

Before you begin

Before you can use the REST API in a client, you must start the sample server or configure Rule Execution Server for your application server (see Starting and stopping the sample server or Configuring, respectively).

About this task

You can use the REST API through a web browser without first logging in to the Rule Execution Server console by adding /apiauth/ to the URL, as shown below. The REST API uses the basic HTTP authentication, or preemptive authentication, as described in HTTP Specifications RFC 2617. This authentication method consists in passing the user name and password in the header in the Authorization header parameter. The browser requests your credentials at the first call or at each session timeout. Most of the available tools that are used to test a REST API also implement this authentication method.

Procedure

Define the request as follows:
  • URL: http://host:port/res/apiauth/resourceName/templateParameters?queryParameters
  • Body: None
  • Method: GET
  • Content-type: any

Results

After the authentication response is successful, subsequent calls to the REST API use URLs that are built on this pattern:
http://host:port/res/apiauth/resourceName/templateParameters?queryParameters

What to do next

You can now write and call REST methods as described in Using the REST API test tool.