Skip to main content
?

Hello World

Overview​

Let’s walk through the steps of creating a “Hello World” API. Refer to below for detailed step-by-step instructions.

Details​

There are numerous ways to configure API AutoFlow.  But there are the first two things that you need to do every time you create a new solution.

  1. Create an API
  2. Create a Server to host the API

Content​

Step 1. Create API​

  1. Create a new API

Create API

b. Create an ID for the API.

Creating An ID
info

For the Hello World example, we will be using the API AutoFlow provided OpenAPI builder. However, you can use your own OpenAPI document using the upload feature.

c. Go to the newly created hello_world API and add a new path

Creating A Path
  1. Enter a name for the path, the path you add will be /hello
  2. Add a method, select the GET method
Adding Path Info

Step 2. Create a Server​

a. Create a new Server

Create Server

  1. Create an ID for the server.

  2. The port number by default is 8080, this is customizable.

    đź’ˇ The server instantly gets hosted on the port number.

  3. Press the Link API button and select the hello_world_api.

Adding Server Info
Linking API

b. Go to the newly created hello_world_server

Create new Hello World Server

c. 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.

Add API Operation

API Operation

d. Add an action(s) to the operation

Click the + Actions button to add an action.

Add Action

e. Select an action

Use string/join action to join two strings.

Joining Two Strings

f. Add an array of string with a delimiter

In our example, we will include to strings Hello and World, with a space a delimiter

Adding String
info

Note that the OUTPUT of the action is stored in a variable called output

j. Map data to HTTP response body

For us to test on the web browser, let’s put the string/join action’s output in the HTTP response body.

k. Select Reference / Data from the data elements

Selecting Data
info

Make sure that the string/join and the reference data have the same variable name, in this case, it's "output".

Step 3. Test the API​

Congratulations! You have just created a new API server!

Testing API

Download Configuration

The below example is available for your reference. Simply download the configuration from below and upload it to your API AutoFlow.