Digia Academy
Digia StudioDiscordLinkedIn
  • Introduction
    • FAQs
  • What's New
    • 2024
      • March
  • DIGIA STUDIO INTRODUCTION
    • Dashboard
    • Builder Tool
      • Navigation Menu
      • Tool Bar
      • Pages and Widgets Panel
      • Canvas Area
      • Properties Panel
    • Creating a New Project
    • Creating new Pages
    • Working with Widget Tree
    • Build Your First App
      • Hello World
      • Bytes App
        • Onboarding
        • Defining API Calls
        • Courses
        • Articles
        • Viewing your App
    • SDK Integration
      • Insert Single Pages from Digia Studio
  • Actions
    • Call API Rest Action
    • Call Rest API
    • Pop Current
    • Pop to Route
    • openUrl
    • Go To Page
    • Post Message
    • Set Page State
    • Wait (delay)
    • Drawer
    • Toast
    • Open Dialog
    • Share
    • Copy to Clipboard
  • Operations
    • API Call
    • Operators
      • Json Operators
      • Logical Operators
      • Date Time Operators
      • Math Operators
      • String Operations
  • BUILDING UI
    • Widgets
      • Form Widgets
        • PinField
        • Calendar
        • Text Form Field
      • Base Widgets
        • Animated Button
        • Check Box
        • Video Player
        • Spacer
        • Stack
        • Wrap
        • Text
        • Avatar
        • Rich Text
        • Image
        • Button
        • Icon
        • Switch
        • Sized Box
        • HtmlView
        • Lottie Animation
        • Linear Progress Bar
        • YouTube Player
        • Circular Progress Bar
      • Layout Widgets
        • ListView
        • Web View
        • Future Builder
        • Conditional Builder
        • Stream Builder
        • GridView
        • Column
        • Row
        • Container
        • Expandable
        • Divider (Horizontal)
        • Divider (Vertical)
        • Carousel
      • Persistent Footers Widgets
        • NavigationBar Widget
      • Page Widgets
        • Stepper Widget
        • Scaffold Widget
        • Paginated Listview Widget
        • TabView
        • AppBar
      • Widget Commonalities
    • Event Handlers
  • Theme
    • Colors
    • Typography
  • DATA AND BACKEND
    • API Calls
      • Setting up API Calls
      • Create API Calls
      • Import API From Curl
  • DEPLOYING YOUR APP
    • Deployment
    • Release History
  • Settings
    • App Settings
    • App Assets
    • Media Assets
  • JARGON
    • Data integration
Powered by GitBook
On this page
  • Creating API calls
  • For GET & DELETE call
  • For POST, PUT & PATCH call
  • Trigger API calls
  1. DATA AND BACKEND
  2. API Calls

Create API Calls

PreviousSetting up API CallsNextImport API From Curl

Last updated 2 months ago

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:

  1. Select API Calls from the left .

  2. Click on the + Add button and select Create API Call.

  3. Enter the API Call Name.

  4. Select the Method Type: GET, POST, DELETE, PUT, or PATCH.

  5. Enter the API URL of the service you want to access.

NOTE: If you want to use a dynamic URL, for example, where 2 is dynamic and where 5 is dynamic:

  1. Replace the hard-coded value with a meaningful name inside the brackets (e.g., from https://reqres.in/api/users/2to https://reqres.in/api/users/[user_id]).

  2. 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

If you selected GET or DELETE as the method type, follow the steps below:

  1. Optional: If the API call requires request headers such as an authorization token, .

  2. Optional: If the API call requires query parameters such as page number or user id, .

  3. 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

If you have selected POST request, follow the steps below:

  1. Optional: If the API call requires request headers such as an authorization token, add a header.

  2. Create a request body for the API call.

  3. 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 Handlers
Setting up API Calls
Navigation Menu
https://reqres.in/api/users/2
https://reqres.in/api/users?page=5
add a header
add query parameters