Connect to API Action

Send or receive data to/from any API without having to write code

Feathery's No-Code API Connectors, an extension of our no-code Rule Builder, allows you to send or receive data to/from any API without having to write code, all within any Feathery form or workflow.

Example Use Cases:

  • Dynamically rendering options for a drop-down

  • Looking up a user in a database or CRM (ex: Salesforce, HubSpot) and prefilling their information

  • Sending form data to your custom API endpoints

  • Running custom validation logic from an API (ex: verify if a user's identity is valid)

Video Demo

How to access

Within the Logic tab of your form, create a Rule within Feathery's No Code Rule Builder. Then, within a Rule, you can define an Action for "Connect to API" which kickstarts the No Code API Connector flow.

1. Define the endpoint

First, go to the Logic tab of your form, click "API Connectors" and press the "Create API Connectors" button.

Set the endpoint you want to use and any headers you want to send. Please refer to your intended API's documentation to determine which endpoint and headers to use. You must also set what type of API request you need to make, such as a GET request for receiving information into your form or a POST request for sending form data to an API.

You can also define what data you want to send to the request. You can reference field values for these as well using the {{field_name}} syntax.

Any data you define in the headers or query parameters (such as sensitive API keys) will not be exposed client side to people filling your form.

For POST requests, you can define the request body that you want to POST to your endpoint. The format is a key (as a string) followed by a string value, with any variables included within the string enclosed in double curly braces, such as:

{ "sample_key" : "{{sample_field_id}}" }

Make sure each field is defined and published first before referencing the field in the request body.

2. Define the API response format

You can define the API response format in two ways:

Option 1: Make a test API call

You can run a test API call with the parameters you defined in the previous step to see the result. If you used any field values for headers or query parameters, you can define them prior to the test API call being run.

Option 2: Input a sample JSON response

You can also paste a sample response (ex: from the API docs) in case you may not be able to call the API just yet

3. Map the API result to form fields

You can configure how to extract data from the API's response. You can configure which fields you want to map to and which parts of the API response to pull from (ex: certain fields in the respones or indices of an array).

Feathery supports pulling and mapping data from nested response fields and lists/arrays.

For example, in the screenshot below, we are mapping the "salesforce-full-name" field to the "Name" field of the first element "records" key in the response json, which is represented by the syntax "records.0.Name" (where 0 represents the 0th/first index of the array/list). You can use the dropdown to see all available mappings.

You can also map multiple fields at once. In this case, we are mapping both the Account Name and Full Name fields.

4. Use the No-Code API Connector in a Logic Rule

Go to the Logic tab of your form and create a Rule. Set the action of your rule to "Connect to API" and select the API connector you created in the previous step. Then, the API connector will run when the rule's trigger is activated.

In the example below, we connect to the Salesforce API whenever the "salesforce-email" field is changed.

Variables

When defining and using your connectors, you may also have access to backend environment variables such as authentication tokens. You may define these via double curly braces in either the API connector headers or the url being passed into the feathery.http interface.

The authentication token for any connected integration can now be used in API connectors. The syntax to reference the auth token is {{integration-name_token}}.

Example variables that you have access to include (but are not limited to):

  • {{salesforce_token}} - your Salesforce integration auth token, if active

  • {{hubspot_token}} - your Hubspot integration auth token, if active

  • {{google-sheets_token}} - your Google Sheets integration auth token, if active (ex: to write new rows to a sheet)

  • {{feathery_auth_email}} - the authenticated email address of your current user, if an auth integration like Stytch or Firebase is turned on

Last updated