The ability for IBM App Connect users to integrate their business apps and systems has taken a major step forward with the introduction of OpenAPI 2.0 support.

What is OpenAPI?

OpenAPI (previously known as Swagger) is a powerful and widely-used specification for defining REST APIs. It is the format used for APIs in IBM API Connect. Now users of IBM App Connect can integrate their OpenAPI documents into App Connect flows, providing simple yet powerful access to back-end services.

Adding an application

All you need to use your OpenAPI application in your App Connect flows is a valid OpenAPI document in JSON or YAML format. (There are some restrictions; see here for details.) The document being used for this example is the swagger.json file, downloadable from the Swagger Petstore site. Petstore is an OpenAPI implementation of a pet store server. It is widely used as a sample to demonstrate the features of OpenAPI. To import the document, scroll to the bottom of the Applications page, or filter by application name, and click the link to add your application. This is the same mechanism by which a user can add an IBM Integration Bus application.

Adding an application in App Connect

This link opens the Add Application page, where the OpenAPI document can be uploaded. You must provide an application name (which will be used to identify the application in the palette) and a short description of what the application does.

Providing a name and description for an OpenAPI application

Now if you navigate back to the Applications page, your new application will appear at the bottom. Connect to the application in a similar way to any other application in the list, by providing a user name, password, or API key as required. For the Petstore example, you can use the sample API key provided on the Petstore site.

Authenticating with the application using an API key

You are now ready to use your application in a flow!

Using your application in a flow

The example flow here is configured to use a Google Sheets event as a trigger. The flow will be started whenever a new row is appended to the Pets spreadsheet. This will trigger a Place Order call to the Petstore API, which sends a pet order to the back-end system. Finally, a confirmation email is sent to the user.

Using the user-defined application in an App Connect event-driven flow

This is one small example, but it is easy to see the power that OpenAPI support gives. Try it out today with the API of your choice, and let us know how you get on!

Join The Discussion

Your email address will not be published. Required fields are marked *