Create API Calls
On this page, you will learn how to create API calls.
Creating API calls
To use an API in your app, first, you have to create the API Call.
Follow the steps below to create an API Call:
Select API Calls from the left Navigation Menu.
Click on the + Add button and select Create API Call.
Enter the API Call Name.
Select the Method Type: GET, POST, DELETE, PUT, or PATCH.
Enter the API URL of the service you want to access.
NOTE: If you want to use a dynamic URL, for example, https://reqres.in/api/users/2 where 2 is dynamic and https://reqres.in/api/users?page=5 where 5 is dynamic:
Replace the hard-coded value with a meaningful name inside the brackets (e.g., from
https://reqres.in/api/users/2
tohttps://reqres.in/api/users/[user_id]
).And then, create a new variable with the same name you provided inside the brackets.
The further instructions are based on the Method Type you selected.
For GET
& DELETE
call
GET
& DELETE
callIf you selected GET
or DELETE
as the method type, follow the steps below:
Optional: If the API call requires request headers such as an authorization token, add a header.
Optional: If the API call requires query parameters such as page number or user id, add query parameters.
Click Add Call to save the API Call.
After making any changes, you must save the API call.
The DELETE API Call can also be defined similarly; just make sure you select the Method Type as DELETE.
For POST
, PUT
& PATCH
call
POST
, PUT
& PATCH
callIf you have selected POST request, follow the steps below:
Optional: If the API call requires request headers such as an authorization token, add a header.
Create a request body for the API call.
Click Add Call to save the API Call.
Trigger API calls
There are two methods to trigger an API call in your app:
Add an Event Handler to trigger the API Call based upon a user gesture.
Add the API Call as a DataSource that gets triggered automatically when the page or widget is loaded on the screen.
You will find the steps for triggering API Calls using either of these two methods on the following pages:
Event HandlersSetting up API CallsLast updated