Data flow

The API Gateway connection point can participate in a data flow to call an external API, evaluate the response, and publish a document for downstream processing. This enables flows to integrate API-based interactions with other connection points in the same orchestration.

Configuring a data flow

Configure a data flow to select the connection point in the API Gateway activity and publish a document based on the API response.

  1. Select the connection point in the API Gateway activity.
  2. Select the document to publish based on the API response.
  3. Complete the configuration and activate the flow.

Uploading an image to an external API

This example shows how to configure an end-to-end data flow that reads an image file and uploads it to an external API by using multipart/form-data.

Scenario: A PNG image file must be uploaded to a product catalog API that accepts multipart/form-data with a parameter named image.

  1. Register the target API.

    In API Gateway, register the target application and import its Swagger or OpenAPI specification. Ensure that the POST endpoint for image upload is indexed.

  2. Create a File connection point to read image files from a directory.

    Configure the connection point to produce an ANY document as output. This ensures that the binary file content is preserved without encoding.

  3. Create an API Gateway connection point with the Send to API or Trigger API scenario.
  4. On the Input Document tab, select the ANY document that is produced by the File connection point.
  5. On the ION API tab, select the product and the POST operation for image upload.
  6. On the Request Body tab, select multipart/form-data as the request format.
  7. For the image form-data parameter, specify this information:
    Content type
    Specify image/png.
    Input Document
    Select the Input Document option.
  8. Configure any additional required parameters, for example, an API key on the Request Parameters tab.
  9. Build the data flow.
  10. Add the File connection point as the source.
  11. Add the API Gateway connection point as the target.
  12. Connect the ANY document from the File connection point to the API Gateway connection point input.
  13. Test the configuration.

    Use the Test API Call function in the connection point with a sample PNG file. Verify that the response is successful.

  14. Activate the data flow.