REST API Node
Last updated
Last updated
The Rest API node in Nected Workflow allows you to make HTTP requests to external APIs, enabling you to integrate data and functionality from various web services into your workflow. This node supports GET, POST, PUT, PATCH, and DELETE methods, allowing you to perform a wide range of operations on external APIs.
By configuring the Rest API node, you can specify the API endpoint URL, request method, headers, and parameters. You can also set the request body for POST, PUT, and PATCH methods. The node supports both JSON and XML request and response formats.
Once the API request is made, the response data is stored in the node's output, which can be accessed by subsequent nodes in the workflow. This allows you to process and manipulate the data retrieved from the external API as needed.
Here is how you can add a REST API node in your workflow editor:
Inside the workflow editor, simply click on the "+Add Node" button.
After clicking that button you will be redirected to the Rest API Connectors Page. There You need to provide all the details regarding the API and then just test the connection using the "Test Connection" button.
Once the API connector is being tested, you can publish it on staging by clicking the button "Publish in Staging". Then repeat the same steps in Production too, and then publish the connection to production by clicking "Publish in Production".
Once your connector is published in production, you can now directly use it in your workflow editor by just clicking the refresh↻ button inside the workflow editor. And your newly created API will be available in the list.
Now, once selected, you can configure the API from this popup screen:
Inside this popup screen, there are 3 tabs you can see. Here is the detail about all these three tabs:
Input Params Tab:
Integration Dropdown: Allows you to choose from a pre-configured list of services for which the REST API will be called. In the screenshot, 'Airtable' is selected, indicating that this REST API node is configured to interact with the Airtable service.
You can also edit the API by clicking the pen 🖊️ icon.
Select Method Dropdown: Here you specify the HTTP method to be used for the API call. The options usually include GET, POST, PUT, DELETE, etc. The method you select will determine the nature of the interaction with the API (e.g., GET for retrieving data, POST for creating data).
Base URL Input Field: This is where you enter the root URL for the API service. It acts as the starting point for the API request. The provided example is https://api.airtable.com/v0/
, which indicates that the API calls are directed to Airtable's base endpoint.
Authentication Dropdown: Determines the type of authentication required for the API call. Options could include 'None', 'Bearer Token', 'Basic Auth', 'OAuth2', etc. 'Private' likely refers to a predefined, secure method of authentication configured within Nected for Airtable.
URL Path Input Field: Appends the specific path to the Base URL to target a particular resource or data set within the API. For instance, if you were targeting a specific table within Airtable, the URL path might include the table's name or identifier.
Headers Section: Sometimes optional, headers can be used to provide additional information to the API call, such as content types, API keys, or other metadata. You can add headers by clicking on 'Add Headers', and you'll likely need to enter both the header name and its value.
Query Parameters Section: Also often optional, this is where you can specify query parameters that modify the request or filter the data being requested. Adding query parameters will typically involve specifying both the parameter name and the value you wish to set.
Expand to see the IP addresses to add to your allow-list Section: Some APIs have IP allow-listing as a security measure. If you need to ensure that your workflow's server IPs are allowed to make requests to the API, you can add them here.
Note: Always ensure that you have the correct permissions and have followed the API provider’s data protection guidelines when configuring API nodes, particularly when dealing with authentication and header information.
Test Results Tab:
Execute the API request to test the connection and response handling. The response (or any errors) will be displayed here.
In the settings tab, you can adjust the timeout time for the Rest API.
The "Timeout after" option allows you to set a time limit for the node's operation. If the node takes longer than the specified time, it will automatically stop running.
If you turn this setting on, then even if the workflow node gets any error, the workflow will continue to execute the next node with the error.
Let's take an example:
Let's say we have these 3 nodes in our workflow:
The first one is a Formula node, the second one is a Rule node and the third one is a database node.
Continue on error can be toggled on or off for each node in the workflow. When this setting is activated, it allows the workflow to proceed to the next node even if an error occurs in the current node. Specifically, if the first node, like "modified_cart," encounters an error while this setting is enabled, the workflow will not be halted. Instead, it will advance to the subsequent node, such as the rule node, with the error details passed along from the previous node. This functionality facilitates the continuation of the workflow despite errors, promoting greater flexibility and resilience in managing workflows by allowing for potential error handling at later stages of the process.
For workflows that involve API calls through an API Node, Response Caching can be turned on to optimize API interactions by using cached responses based on defined inputs.
Open the API Node: Select the API Node within the workflow editor.
Access the Settings Tab: Go to the Settings tab of the API node.
Enable Response Caching: Toggle the Response Caching option to activate it.
Configure Caching Parameters:
Key Parameters: Select input parameters that will use cached responses during workflow execution.
Cache Expiry Time: Set the duration (Days, Hours, or Minutes) for cached data to remain valid.
Clear Cache: Specify which environment (Staging or Production) cache data to clear, if needed.
The 'Test' and 'Save' buttons at the bottom of the tab are used to test the API call with the configured parameters and to save the node configuration if the tests are successful.
From the dropdown list, Click the REST API node.
After Selecting Rest API in the Node Options, There you can see existing Rest API Connectors and select one for your workflow. If you don’t have any existing Rest API or if you want to create a new one then you can do that by clicking on the "+RESTAPI" button.
Also, if you want to create another API, then you do that from the same dropdown option. Basically at the end of the dropdown list, there is a "+Create Connector" button which will lead you to the connectors page again. And then the flow of creating the API will be same as the previous one.