Call a REST API using the RESTRequest node


Learn how to use a RESTRequest node to call a REST API by exploring this simple example.
OVERVIEW

This tutorial demonstrates how a RESTRequest node can be used to call REST APIs. A simple application has been created, containing a message flow which receives XML data over HTTP (using an HTTPInput node). The XML data is parsed and passed to a RESTRequest node. The RESTRequest node's properties specify where the REST API is running (in this tutorial this will be your localhost), and the Request parameter to send. The REST API implements a GET operation, in which a graphical data mapping node is used to 'retrieve' information (actually the values are hard coded in a map) about a user based on the input data.

In IBM Integration Bus, an application is a container for all the resources that are required to create a solution. An application can contain IBM Integration Bus resources, such as flows, message definitions, libraries, and JAR files. In this tutorial, an application is used to hold the message flow which contains the RESTRequest node. A referenced shared Library is used, to hold an XML schema to describe the input data and a Swagger file to describe the interface of the REST API which is invoked.

This tutorial takes approximately 5 minutes.
Tutorial Topics
  • REST Request node
  • Calling a REST API using the RESTRequest node
  • Transformation using graphical data mapping
Learning outcomes
  • Understand how to use the RESTRequest Node to call a REST API.