Skip to main content
?

API

OpenAPI model​

An API in API AutoFlow is simply an OpenAPI model. You don’t need to be an expert in OpenAPI. API AutoFlow provides an easy-to-use graphic-based API builder.

A Server is configured to perform what is defined in the API.

General API Configuration

Read more about OpenAPI specifications (previously Swagger)

The API is used by many features in the API AutoFlow. But, it always plays the same role as an API describing the format for REST APIs and validating the API calls.

When used to receive API calls​

The OpenAPI is used to determine how to receive the API calls.

For example, the server you create will have various endpoints and parameters. You would first define that in the OpenAPI and then create a server for each of the endpoint operations.

When used to make API calls​

The OpenAPI is used to make API calls.

For example, Google published OpenAPI for their cloud services. API AutoFlow provides a convenient way to upload the OpenAPI doc and automatically populate the API call parameters.

πŸ’‘ At a high level, you can understand that OpenAPIs are used both for external and internal API calls.

Configuring the API​

Create a new API​

Create New API

Create an ID for the API or Upload OpenAPI document​

API ID Creation

πŸ’‘ For this example, we will be using the API AutoFlow provided OpenAPI builder. However, you can use your own OpenAPI document using the upload feature.

Enter the API title and description

API Details

Create a Path​

Go to the newly created test API and create a new path, choose a proper name for the path. The path you create will be /hello

Creating a Path

Add a field​

Field refers to the API method. As shown in the picture above, the chosen field for this API is a GET method.

How to use an API​

in a Server​

a. Create a Server.
Link to Server Guide

b. Go to the newly created hello_world_server and press the edit button

Editing the API

c. Press the Link API button and select the hello_world_api. Change the port number to 1234

Linking the API

πŸ’‘ The server instantly gets hosted on the new port number.

d. Add the API operation Now that you have lined the server with the API, you can start creating the operations for each of the paths.

in a Service​

Create a Service.
Link to the Service guide

In the example below, we have created

  • Input with argument username accepting only a string
  • Output with argument name_filtered responding as a string

a. Add a new Action

Creating a New Action

c. Select the API Operations Action

Selecting New Operation

d. Click the Choose an API Operation button and select the path

Adding a Path

e. The parameters will auto-populate based on the information in the OpenAPI. But you can always overwrite the information.

API Operation Overview

πŸ’‘ Note that the result of the API call will get stored in a variable called output. Click the button labeled [variable output] to change where you would like to store the data.