Unlock the Power of External APIs with CodelessAPI's API call Module

Published on March 14, 2024

Introduction

Integrating external APIs has become a crucial aspect of building robust and feature-rich applications. We at CodelessAPI, the no-code solution for creating APIs and automating workflows, have introduced a powerful new module that streamlines the process of interacting with external APIs: the API Call module.

With the API call module, you can now effortlessly connect to third-party APIs, retrieve data, and leverage their functionalities within your CodelessAPI workflows. This new feature opens up a world of possibilities, allowing you to seamlessly integrate external services and enrich your applications with a wide range of capabilities, all without writing a single line of code.

Key Features

  • URL Configuration: Specify the URL of the external API you want to interact with, making it easy to connect to various third-party services.
  • HTTP Method Selection: Choose from common HTTP methods like GET, POST, PATCH, and DELETE, allowing you to perform various operations on the external API.
  • Header Management: Add custom headers to your API requests, including authentication tokens, content types, and other necessary parameters.
  • Request Body Configuration: Define the request body for POST, PATCH, and other methods that require data payloads, enabling you to send complex data structures to the external API.
  • Output Column Mapping: Specify the expected output columns from the external API response, ensuring seamless integration with subsequent modules in your workflow.
  • Dynamic Value Mapping: Map values from previous modules to the headers, body, or URL parameters of the API call, enabling dynamic and context-aware API interactions.

Usage Scenarios

The API call module opens up a wide range of possibilities for integrating external data and services into your CodelessAPI workflows. Here are a few examples of how you can leverage this powerful feature:

1. Authentication and User Management

Integrate with authentication and user management services like Auth0 or Firebase Authentication to securely authenticate users and manage their access within your applications. By calling the appropriate APIs, you can handle login, registration, and user profile updates seamlessly.

2. Data Enrichment

Enhance your existing data by integrating with external APIs that provide complementary information. For example, you could fetch location data from a geocoding API based on addresses stored in your database, or retrieve real-time stock prices for financial applications.

3. E-commerce Integration

Connect with popular e-commerce platforms like Shopify or WooCommerce to manage product catalogs, orders, and customer information directly within your CodelessAPI workflows. This streamlines business operations and reduces the need for manual data synchronization.

4. Web Scraping

Leverage web scraping APIs to extract data from websites and web pages, allowing you to gather information from various online sources and integrate it into your workflows. This can be particularly useful for monitoring competitive landscapes, gathering market intelligence, or collecting data for research purposes.

Getting Started

To start using the API call module in your CodelessAPI workflows, follow these simple steps:

  1. Add the API call Module: In the CodelessAPI builder, navigate to the "Operations" section and drag the "API call" module onto the canvas.
    API call Module on Canvas
  2. Link the Start module to the API call module: Connect the "Start" module to the "API call" module by clicking the "Start" module, clicking "Link" then clicking the "API call" module. You can remove a link by clicking on the link itself.
  3. Link the API call module to the End module: Connect the "API call" module to the "End" module by following a similar method to above.

    You can also link other modules such as data sources or transformation modules, to enable dynamic data mapping and seamless integration. Follow the example below for more details.

  4. Configure the API call: Click on the API call module and select "Configure". Here, you can specify the URL, HTTP method, headers, request body, and expected output columns for the external API you want to integrate.
    API call module configuration
  5. Test your workflow: Use CodelessAPI's built-in testing capabilities to ensure your API call is working as expected, and then deploy your workflow to start leveraging the power of external APIs within your applications.

    Initiate a test run of the API using the "Run" button. This helps identify potential issues and validates the API endpoint's functionality.

  6. Deploy and remotely trigger your workflow: After testing, you can trigger your workflow remotely by either setting a timer via the Start module, or by using the API link for your module and calling it. To use the API, click on the "Start" module and select "Configuration" to obtain the API link.
  7. Note - Output will be an array: Data transfers between modules in CodelessAPI is done by sending JSON arrays of the previous module to the next module. So if your API returns a JSON object that is not an array, it will be converted to an array when outputted from the "API call" module.

Advanced Usage

One of the powerful capabilities of the API call module is the ability to dynamically map values from previous modules to the headers, body, or URL parameters of the API call. This enables context-aware API interactions and facilitates more complex workflows. Let's explore an example scenario:

Example: Handling Authentication Tokens

Imagine you have an API that requires an authentication token in the headers for certain requests. You can set up a workflow where the first API call module handles the authentication process, and the subsequent API call modules dynamically use the obtained token for authorized requests.

  1. Add the API call Module: Similar to above, add the "API call" module to the canvas. Then link the "Start" module to the "API call' module.
    API call Module on Canvas for advanced example
  2. Authentication API call: Configure an API call module to handle the authentication process, such as a POST request to an authentication endpoint. Set the output columns to include the token received from the authentication response.
    API call module get token configuration
  3. Subsequent API calls: Add another API call module to your workflow and connect it to the output of the authentication API call module. In the headers configuration, specify an "Authorization" header and select "map" for the token. From the drop down, select the previous one of the output columns defined from the previous API call to map the token value from the previous module's output.
    API call module to pass the token configuration
  4. Token Formatting (Optional): If the API requires a specific token format, such as "Bearer <token>", you can introduce a Code module between the authentication API call and the subsequent API call. In the Code module, you can format the token as needed and pass the formatted value to the next API call module. Remember, as the output of the API call is converted to an array, so you will need to index the output to access the token.
    Code Module Configuration

By leveraging the dynamic value mapping capabilities of the API call module, you can create intricate workflows that seamlessly handle authentication, authorization, and other complex API interactions, all without writing a single line of code.

Conclusion

The introduction of the API call module in CodelessAPI empowers you to seamlessly integrate external APIs into your workflows, unlocking a world of possibilities. Whether you're looking to enhance your data, leverage third-party services, or automate complex processes, this new feature provides a flexible and user-friendly way to harness the power of external APIs without writing a single line of code.

Start exploring the API call module today and take your CodelessAPI workflows to new heights. If you have any questions or need assistance, feel free to reach out to our dedicated team at hello@codelessapi.io. Feel free to schedule a meeting if you'd prefer to chat live. We're here to support you every step of the way.

Unlock the full potential of external APIs and drive your applications forward with CodelessAPI's powerful and versatile no-code platform.