Hello World
Overview​
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.
- Create an API
- Create a Server to host the API
Content​
Step 1. Create API​
- Create a new API
b. Create an ID for the API.
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
- Enter a name for the path, the path you add will be /hello
- Add a method, select the GET method
Step 2. Create a Server​
a. Create a new Server
Create an ID for the server.
The port number by default is 8080, this is customizable.
đź’ˇ The server instantly gets hosted on the port number.
Press the Link API button and select the hello_world_api.
b. Go to the newly created 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.
d. Add an action(s) to the operation
Click the + Actions button to add an action.
e. Select an action
Use string/join action to join 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
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
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!
Download Configuration
The below example is available for your reference. Simply download the configuration from below and upload it to your API AutoFlow.