HTTP API

In this article, we'll explore how you can specify URLs in your HTTP Request without actually having to connect the data source or connect your own HTTP API data source. We will also review the data source's usage.

Using the HTTP API data source

Without connecting your own HTTP API, you can still run your requests with UI Bakery. In this case, you simply need to create a new action, select the HTTP API data source, and the HTTP Request action will be selected automatically. After that, just specify the URL of your request directly in the action. This is the main required parameter for the HTTP Request action type.

You can also specify additional parameters which may be required depending on the API:

  • Method - the HTTP Request method (GET, POST, PUT, etc.)

  • Base URL - When a data source is connected to the action, Base API URL can be provided not to specify the whole URL for each action. You can change it once on the data source level for all actions.

  • URL - the URL or path of the API endpoint

  • Headers - the HTTP Request headers (string key-value pairs)

  • Body - For POST/PUT/DELETE/PATCH methods, you can specify the HTTP body as a JSON object or as plain text.

  • Query Params - the URL params added to the Request URL

  • Transform result toggle - You can pass a JS function to transform execution result or fix an error. The {{data}}, {{error}}, and {{res}} variables represents the result of the request.

For example, you can pass a JSON object in the Body of your request by adding a Content-Type header to it:

Configuring your own HTTP API data source

Prerequisites

If your API is hosted behind a Firewall, you need to add our IP addresses to the Firewall whitelist.

Connecting the data source

If your HTTP Requests share similar settings such as Base URL or Auth headers or your API requires authentication, you can configure your own HTTP API as a data source. To do so, follow the instruction below:

  1. On the Data sources page, click Connect, and select HTTP API in the Data sources list.

  2. Specify the Base URL and any additional parameters if necessary. To set up authentication, refer to this guide.

  3. Click Connect Datasource to save the configuration.

Usage

Once you've established the connection to the data source, you can start interacting with its data via API. For this purpose, you can use the HTTP Request action step and configure the HTTP parameters applicable to your API. UI Bakery supports all HTTP methods, Headers, Body, and Query Parameters.

Last updated

Was this helpful?

OSZAR »