Getting levels

This part of the tutorial series shouldn't be too taxing: the goal is to create a flow that retrieves the levels from the database. (This is mostly the same as retrieving the list of badges.)

Step 1: Create a "API" flow

  1. In the Explorer pane, click Create new.
  2. Select API.
  3. Type Get levels.
  4. Tap the Return key.

Step 2: Configure the "Start" component

  1. Open the Start component.
  2. From the Method dropdown, select GET.
  3. In the URL field, enter /get-badges.

Step 3: Get the levels from the database

  1. Add a Select component to the flow.
  2. Rename the component to selectLevels.
  3. From the Table dropdown, select levels.

Step 4: Create the HTTP response

  1. Add an End component to the flow.
  2. From the Status Code dropdown, select 200 OK.
  3. From the Content Type dropdown, select filePath.
  4. In the Body field, enter selectLevels.data.

This is what the complete flow looks like: