Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

Call API Endpoints from interface workflows

Calling API Endpoints from your interface allows you to execute secure logic.

Here is how you can call an API Endpoint from the interface:

1. Add the action

  1. Create or open a workflow in the Interface tab (for example, on a button On click)
  2. Click + Add an action
  3. Hover From Data & APIAPI
  4. Select your API Endpoint from the list

2. Map inputs

With the API Endpoint action selected, you can configure what you wish to use for the values of the input parameters. You can type a fixed value, or bind it and pass a dynamic value, such as the value of a variable or input.

UNDERSTANDING INPUT PARAMETERS

Input parameters are used to pass dynamic values to API Endpoints, allowing for the API Endpoint to perform logic specific to your inputs, such as retrieving records that match your search input, or creating records with the data you passed in.

Learn more about input parameters →

3. Handle results

API Endpoints will always return a response, and in many cases, you will want to use the response returned by an API Endpoint in some way.

Here are some examples of a use case for an API Endpoint and how you may want to use the response in the interface:

Create order and redirect to detail page

Imagine you have an API Endpoint to create an order for a user.

  1. Interface calls the API Endpoint to create an order for the current user
  2. API Endpoint returns the orderId of the newly created order
  3. Navigate the user to an order detail page for the new order /orders/{orderId}

Update profile and refresh UI

Imagine you have an API Endpoint to update the information of a user, and on the page you show the information of the user currently being viewed.

  1. Interface calls the API Endpoint and passes as inputs which user to update and what their new information should be
  2. API Endpoint returns updated userData
  3. Depending on if you are using a view or variable to show the data of the user being viewed:
    • If variable — Update variable used to show information currentUserData = userData returned by API
    • If view — Refetch the view to get the latest data of the user

Securing API Endpoints

By default, any authentication restrictions you have set on the API Endpoint will automatically be enforced.

This means if you have the API Endpoint set to only be usable by Authenticated users, then whenever you try to call the API Endpoint from the interface, it will only work if you are logged in. If you are not logged in, the API Endpoint will return an error.

CUSTOM MIDDLEWARE

To introduce more granular access controls in your API Endpoints, check out the dedicated documentation for securing API Endpoints.

Securing API Endpoints →

CONTINUE LEARNING

Manage users and roles for access control.

Users and roles →