Creating a flow for an API

Create a flow for an API by using IBM App Connect Enterprise Designer.

Before you begin

Start IBM App Connect Enterprise Designer by running the Designer command as described in Starting IBM App Connect Enterprise Designer.

About this task

You can define models, operations, and flows for an API. For more information about APIs, see Developing integration solutions by using REST APIs.

The procedure for this task describes how to create a new flow. Alternatively, if you have access to an existing flow, which partially meets your requirements, you can import the flow as described in Importing a flow and then edit it in the API editor as described in this topic.

You can also create a new flow by using an IBM App Connect Enterprise Designer template as described in Creating a flow from a template.

Procedure

  1. Access the API editor by using one of the following methods:
      1. In the sidebar navigation menu, click Home to open the Home page.
      2. Click Create flows for an API to open the API editor.
      1. In the sidebar navigation menu, click Designer to open the Designer page. Any flows that you created before are displayed.
      2. Click New to open the menu.
      3. Select Flows for an API to open the API editor.
    The API editor opens. The Designer tab and the OpenAPI tabs are visible.
  2. Select the Designer tab.
  3. In Model name, enter a name for your model; for example, myModel.
  4. Click Create model to open the configuration page for myModel.
    The Properties tab and the Operations tab are visible.
  5. Select the Properties tab.
  6. In the section "Add properties to your model", enter a property for your model in Property name; for example CustomerName.
  7. Select a type for the property; for example, String.

At step 9, you have the choice of adding more properties from an application if you select it from the Catalog page. For any designer connector nodes for which you did not create an account in Creating accounts, you must create an account before you can add the property by completing step 8.

  1. Optional: Create an account and configure the connector by using one of the following methods:
    • If there are existing accounts, they are listed in a menu labeled Accounts:
      1. Click the down arrow to scroll through the menu and select Add a new account.
      2. Enter your credentials.
      3. Select the action that you want the connector to perform. For example, for the connector Slack, you can select Messages > Send message.
      4. Enter the required details to configure the connector.
      5. Click Connect to create your account.
      6. For more information about identifying connection details, see How-to guides for apps.

    • If there are no existing accounts, create a new account by completing the following steps:
      1. Click Connect.
      2. Enter your credentials.
      3. Click Connect.
      4. Select the action that you want the connector to perform. For example, for the connector Slack, you can select Messages > Send message.
      5. Enter the required details to configure the connector.
      6. Click Connect to add the configured connector to your flow.

    For more information about identifying connection details, see How-to guides for apps.

  2. Add more properties by using one of the following methods:
    • Add more properties by clicking Add property and entering values for Property name; for example, OrderNumber and selecting values for type from the drop-down menu; for example, Number.
    • Add more properties by clicking Select properties from applications, and selecting an application from the list. For example, Callable Flows. Alternatively, you can connect to additional applications by clicking Applications and selecting an application from the Catalog page. For example, Slack.
      When you finish adding all of your required properties, click Add property.
  3. In the model configuration page, select the Operations tab.
  4. Click Select an operation to add to open the drop-down menu.
  5. Select an operation. For example, if you entered myModel in Model name at step 3, then you can select the menu option Create myModel.
  6. Click Implement flow to open the flow in an editor window.
    The editor window opens. A Request node and a Response node are displayed.
  7. Edit the flow as required by clicking the nodes to open a configuration page.
    1. For the Request node, click Sample data to display the Context and sample data table. Update the values for CustomerName and OrderNumber as required. For example "Smith" and "123."
      Close the configuration page by clicking x.
    2. For the Response node, update the fields as required. Optionally, click Sample data, Insert a mapping, or Insert a function and select the options that you require from the drop-down menus.
      Close the configuration page by clicking x to return to the editing window where the flow is saved automatically.
    3. Rename the flow by editing the name field.
    4. Click Done.
      The flow is ready to test. The status is displayed as "Draft (ready to deploy)."

What to do next

Test your API flow as described in Testing a flow for an API.