Connecting to an App Connect REST API

IBM® App Connect Enterprise 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 or an imported OpenAPI 3.0 document (in either JSON or YAML format), which defines the REST API and the operations that are available. When you download the Swagger document or the OpenAPI 3.0 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

  1. From IBM App Connect, download the Swagger document or the OpenAPI 3.0 document for the App Connect API that you want to use, such as the GoogleSheetsAPI. Import the document into the appropriate application folder in the IBM App Connect Enterprise workspace.

    To import the API document, right click the application and select Import > REST APIs > REST API definition to open the Import a REST API definition dialog. Then, pick either select from workspace or retrieve from a URL to import the document.

    When you have imported it, the Swagger document or OpenAPI 3.0 document is visible in the Application Development view in the REST APIs Catalog and the Other resources folder of your project that contains your application.
  2. Create a message flow to include the AppConnectRESTRequest node.
    For more information about creating a message flow, see Creating a message flow.
  3. Drag an AppConnectRESTRequest node from the palette onto the message flow canvas.
  4. Configure the AppConnectRESTRequest node by setting the following properties in the Basic tab of the node:
    1. In the Definitions file field, specify the Swagger document or OpenAPI 3.0 document that contains the definitions of the REST API operations that you want to invoke.
      To select the Swagger document or the OpenAPI 3.0 document, click Browse, and then select the required file from the list that is displayed in the REST API Definitions File Selection dialog, and click OK. (The file is in *.json or *.yaml format.)
      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.
    2. Select the operation that you want to invoke.
  5. 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.
  6. Configure the remaining properties of your AppConnectRESTRequest node.
    For more information about these properties, see AppConnectRESTRequest node.
  7. Configure the security credentials for interacting with the REST API, by using the mqsisetdbparms command command.