To create an API with the GUI is very straightforward, in this section we will create a very simple API that has no special elements set up:
Step 1: Navigate to the API listing Page:
Step 2: Select the “Add API” button:
Step 3: Set up the base settings for your API:
In this section:
- API Name: The name you want to give this group of endpoints, this will represent the API
- API Listen Path: The URL segment that will map to this API, e.g., if set to
widgetsthen the full API URL will be
https://your-gateway-domain/widgets(What about the API Slug? This is not used in a Pro On Premise install, you can set the listen path directly.)
- Target URL: The upstream origin that hosts the service you want to proxy to
- Enable Round Robin Load Balancing: This allows you to enter more than one target URL, we will ignore this for now.
Step 4: Set up the security option for your API
Scroll to the bottom of this page, and you will see:
In this section:
- Authentication mode: This is the security method to use with your API, there can be only one per API. In this case, set it to Auth Token, this is the simplest security mechanism to use
- Auth Key Header Name: The header name that will hold the token on inbound requests. The default for this is
- Allow Query Parameter As Well As Header: Set this option to enable checking the query parameter as well as the header for an auth token, for this guide, leave this set to false.
- Use Cookie Value: It is possible to use a cookie value as well as the other two token locations. Set this value to false
Step 5. Save the API:
To save and publish the API, use the “Save” button at the top of the screen:
Once saved, you will be taken back to the API list, where the new API will be shown.
To see what URL your API has been given, simply select the API from the list to open it again, and the API URL will be displayed in the top of the editor: