Implementing an operation in a REST API

Use the REST API Editor in the Application Development view to implement operations in a REST API.

Before you begin

About this task

Operations in a REST API are implemented as a subflow, and you must use the REST API editor to create an empty subflow for each operation. You can then implement the operation by adding any of the standard IBM Integration Bus message flow nodes to the subflow.

If you do not implement an operation, you can still deploy the REST API to an integration server. However, when an HTTP client attempts to call an operation that has not been implemented, an HTTP 501 Not Implemented status code is returned to the client.

Procedure

To implement an operation in a REST API, complete the following steps:

  1. Open the REST API that contains the operation that you want to implement.
    The REST API Editor is in the Application Development view under the REST API project.
  2. Locate the operation in the REST API Editor. Operations are listed under the Operations heading, and are grouped by resource.
  3. The Header section shows the details for the REST API base URL.
  4. The Resources section shows the operations for each resource.
    Click this button to create a subflow for the operation:REST API open subflow button. If you have already defined a subflow for the operation, that subflow is opened. When you click this button, you are prompted to confirm that you want to save the REST API; this ensures that the nodes that you add to the subflow are correctly defined with the current definition of the REST API. The subflow is opened in the Message Flow Editor, and it is brought to the front.

    Use the hover-help that is provided for each button to get information about the associated action.

  5. Implement the operation by adding any of the standard IBM Integration Bus message flow nodes to the subflow.
  6. Access the REST API operation information, REST API operation parameters, and REST API request and response body, as described in Implementing REST API operation processing in the subflow by using message flow nodes.

Results

The operation is implemented in the REST API.

What to do next

You must package and deploy your REST API to an integration server, as described in Packaging and deploying a REST API.
You can also complete the following optional tasks: