IBM® Integration Bus provides an AppConnectRESTRequest node,
which enables interaction with an IBM App Connect REST API.
About this task
You can use an AppConnectRESTRequest node
in a message flow to issue requests to an IBM App Connect REST API. The AppConnectRESTRequest node
uses an imported Swagger document (in either JSON or YAML format),
which defines the REST API and the operations that are available.
When you have downloaded the Swagger document, you can import it from
your toolkit workspace and select the operations that you want to
invoke. For more information, see AppConnectRESTRequest node.
Alternatively,
you can configure a connection to an App Connect API by using an App Connect REST Request pattern,
which is available through the Patterns Explorer. For more information
about using patterns, see Developing integration solutions by using patterns.
Procedure
- From IBM App Connect,
download the Swagger document (swagger.json or swagger.yaml)
for the App Connect API that
you want to use, such as the GoogleSheetsAPI, and import it into the
appropriate application folder in the IBM Integration Bus workspace.
When
you have imported it, the Swagger file appears in the Other
resources folder of your application.
- Create a message flow to include the AppConnectRESTRequest node.
- Drag and drop an AppConnectRESTRequest node
from the palette onto the message flow canvas.
- Configure the AppConnectRESTRequest node
by setting the following properties in the Basic tab
of the node:
- In the Definitions file field,
specify the Swagger document that contains the definitions of the
REST API operations that you want to invoke.
To select
the Swagger document, click Browse, and then
select the required swagger.json or swagger.yaml file
from the list displayed in the REST API Definitions File Selection
dialog, and click OK.
The
operations that are contained in the selected App Connect API (such as GoogleSheets.create
)
are now listed in the Operation field of the AppConnectRESTRequest node.
- Select the operation that you want to invoke.
- The Request tab automatically lists
any parameters that are required for the selected operation. You can
enter a literal value, a location in the message tree, or a location
in the Local Environment.
- Configure the remaining properties of your AppConnectRESTRequest node.
- Configure the security credentials for interacting with
the REST API, by using the mqsisetdbparms command command.