Call Rest API
The Call REST API action allows you to trigger a pre-configured API call directly from your app. It is typically used to send or retrieve data from a remote server based on user actions or events.
Refer to Define API Calls on how to define and then use.
Watch this on Youtube: https://www.youtube.com/watch?v=afWKuKP0Fow
β
Common Use Cases
Submitting a form to a backend service
Fetching dynamic data to update the UI
Sending user input to an external system
βοΈ Default Behavior
By default:
Data Source
The API call is executed using the selected API Call
Success / Error Handling
If On Success or On Error flows are configured, they are triggered conditionally based on the response and success condition
Visual Feedback
No loading or error UI is shown automatically β use actions like Show Toast or Show Loading for user feedback
π¦ Properties
API Call
Dropdown
β
Select the pre-configured API call to execute
Success Condition
Expression (Boolean)
β
Optional expression to determine if the API call was successful
On Success
Action Flow
β
Actions to execute when the API call succeeds
On Error
Action Flow
β
Actions to execute when the API call fails
π¦ How to use

Add the action to a widget (e.g. on form submission or button click)
Choose Call REST API from the action list
Select the desired
API Call(Optional) Configure a success condition expression to determine success/failure
(Optional) Configure On Success and On Error flows based on the API outcome
π¦ Response Payload (Available in Expressions)
When the API call completes, the response is made available as a response variable with the following fields:
body
The response body data
statusCode
The HTTP status code of the API response
headers
The response headers as a map
requestObj
Details about the request (URL, method, headers, data, query parameters)
error
Error message (if any) - null for successful responses
You can access these fields in expressions using response.body, response.statusCode, etc.
π― Success Condition
The success condition is an optional expression that determines whether the API call is considered successful. If not configured, all responses are treated as successful.
Example expressions:
isEqual(response.statusCode, 200)- Success only on HTTP 200and(gte(response.statusCode, 200), lt(response.statusCode, 300))- Success on 2xx status codesisEqual(jsonGet(response.body, 'success'), true)- Success based on response body content
π‘ Examples
Basic API Call with Response Handling:
Select "getUserData" as the API Call
Add Set App State action in On Success to store
response.body
Conditional Success Based on Response:
Select "submitForm" as the API Call
Set success condition:
and(isEqual(response.statusCode, 200), isEqual(jsonGet(response.body, 'status'), 'success'))Add Show Toast action in On Success with success message
Add Show Toast action in On Error with dynamic error message
Error Handling in On Error Flow:
Select "updateProfile" as the API Call
Add Show Toast action in On Error with error message
π Related Documentation
Setting up API Calls - How to configure API calls for use with this action
Create API Calls - Creating and managing API call configurations
Show Toast - Display user feedback messages
Set App State - Update application state with API response data
Last updated