Quick start

Quickly get started to write your first flow, and learn the basics of OpenAPI development.

3 minute read

Import your first API

  1. Navigate to API Doc & Test
  2. Click on the + OpenAPI button
  3. In the input box, enter:
    https://docs.axway.com/bundle/api-builder/page/samples/openapi/bookstore.yaml
  4. Click Fetch from URL
  5. It will show a Summary of the API. Click Save to finish importing the API

OpenAPI import

Your first flow

After importing the API, the API Doc & Test shows the rendered OpenAPI specification. The role of the developer in API Builder is to implement these operations using flows, so we will start by creating a flow for GET /books/{isbn}.

  1. Find the operation for GET /books/{isbn} and click the Create Flow button. This will bring you to the flow editor.
  2. In the Flow-Nodes panel to the left, find the HTTP response flow-node HTTP response flow-node
  3. Then click and drag the HTTP response flow-node on to the graph on the right. It will automatically add this to the Start node.
  4. In the flow-node properties panel on the right, find the Status property.
  5. In the Status property, change the Selector drop-down to Number.
  6. In the Status property, enter the value: 200, representing HTTP success.
  7. In the flow-node properties panel on the right, find Body property. It should appear disabled.
  8. In the Body property, enable the property by clicking the toggle switch.
  9. In the Body property, change the Selector drop-down to Object.
  10. In the Body property, enter the value:
    {"id":"1234","isbn":"1234", "title":"Moby Dick", "author":"Herman Melville","published":"1851-10-18"}
  11. Click Close and then Save and exit

OpenAPI edit flow

After the server restarts, you are brought back to the API Doc & Test page with the summary of your API. Note that the button associated with the GET /books/{isbn} operation now says, Edit Flow. This is because this operation is now bound to a flow. You can edit the flow as many times as is necessary to fully implement the operation. You can read more about flows here.

Try your API

Now that your GET /books/{isbn} is implemented, you can invoke your API.

  1. Click the GET /books/{isbn} row to expand the GET operation
  2. Click Try it out
  3. In the isbn parameter field, input 1234
  4. Click the Execute button (you may need to scroll down)

Accessing the API specifications

The OpenAPI specifications you import are served by the API Builder application. From the UI, you can click on the API Doc & Test page, and see all specifications, and their URLs.

The specifications are bound under the /apidoc path, for example, the OpenAPI specification for the Bookstore example can be downloaded from http://localhost:8080/apidoc/openapi/bookstore.yaml.

Some parts of the API specification can be tweaked from the apidocs.overrides configuration. The “/apidoc” prefix is configured by changing the apidoc.prefix in the configuration.

Links to all of your application’s API specifications can be discovered outside development by accessing the /apidoc path directly. For more information see API discoverability.

Last modified May 18, 2022: Nantes Release Notes (#83) (2311332)