Skip to main content

APIs

1. What is an API ?

An API is a set of rules and protocols that enables different software applications to communicate and interact with each other. APIs are used to facilitate integration and data exchange between different platforms, services, and systems.

2. How to create an API

SoftyFlow give you the ability to create an API in easy way by accessing the API section situated on the left-hand side of the builder interface and give a name to your API.

API

2.1 Define an API

To establish an API, one can employ native code or simply utilize pre-defined actions. To select the desired development mode, simply click on the toggle switch button located at the upper-middle position.

SoftyFlow provides a range of variables that can be utilized for API development such as SF_body, SF_headers, SF_query, SF_mode and SF_initiator.

2.2 Configure an API

For API configuration click on the settings icon button to open the slider associated with the API. This slider provides a comprehensive view of the API's informations.

API

Within the API configuration slider, you will find different sections for configuring specific aspects of the API's and acquiring additional informations pertaining to the API.

During the configuration process of an API within Softyflow, the administrator has the ability to modify the API's name, define the access rights to the API by selecting either a group of users or designating it as public.

Within the identical API configuration slider, we find inforrmation about API, varibales that can be utilized for API development and the logs. The following are the details about API's informations:

API :

  • URL: The URL that identifies the location where the API is available.
  • Method : Action that can be performed through an API.
  • Body : Object refers to the payload or data that is included in the request body when interacting with an API.

Variables:

  • SF_body : Object contains API body data.
  • SF_headers : Object contains API header data.
  • SF_query : Object contains API query data.
  • SF_mode : The execution mode of the API.
  • SF_initiator : Object contains the user who launched the API.

Logs :

Logs capture relevant data such as the user who launched the API, the API launch date, and the result of the API (This information can be accessed by clicking on the eye icon located on the right of the logs list table).

3. Test and run the API

3.1 Test an API

SoftyFlow provides the capability to perform API testing during the development phase. If your API incorporates variables, you have the option to define test variables, typically in the form of a JSON object.

API

You can initiate the testing phase by clicking on the eye button. The resulting output will be displayed in the lower section.

API

3.2 Launch the API

To initiate the API, one may employ a pre-defined action called "InvokeApi" or employ the corresponding URL.

  1. Lauch the API using InvokeApi action :
API

Subsequently, select your desired API and specify the variable name to which the returned data from the API will be assigned.

API

You also have the option to append the body of the API:

API
  1. Launch the API using axios :

Examples

let body = {
"email": "client1@gmail.com"
}
let apiUrl : "https://softydev.softyflow.io/api/v1/api/6491696d1ef51ed2f7044b79?SF_mode=prod" // API URL
// SF_mode values : test, uat, prod
let result = await axios.post(apiUrl, body);