Skip to main content
Currently, the API chat component is only being supported for WhatsApp Bot, Coming soon for the rest of the channels.

What is an external API?

An external API (Application Programming Interface) refers to a set of rules and protocols that allow one software application to interact and communicate with another external software system, service, or platform. It enables different software programs to access and exchange data and functionalities seamlessly, even if they are developed by different organizations or run on different servers.

Types of APIs

There are several types of APIs, each serving specific purposes and use cases.
We are currently supporting the JSON-based RESTful APIs with the API key, JWT Token, or public APIs

Workflows of using APIs in ChatFlow

Here is the flow for using the APIs in the Chatflows 235 Call External Apis In Your Chat Flows Botpenguin 1 Pn

Using APIs in the Chatflows

To seamlessly integrate APIs into your chat flows in Cube6, follow these steps:

Step 1: Access the Cube6 Dashboard

  • Log in to your Cube6 account and access the dashboard.

Step 2: Navigate to the Developers Section

  • From the side navigation bar, locate and click on β€œMore.”
  • Within the β€œMore” section, select β€œDevelopers.”

Step 3: Prepare Custom Attributes

  • Before proceeding, ensure you have added all the necessary custom attributes that you’ll require for the API interactions. Custom attributes will help capture and manage data. Refer to the doc before creating and managing the custom attributes

Step 4: Add a New API

  • In the β€œDevelopers” section, find β€œYour APIs” and click on β€œAdd API” at the top right corner.

Step 5: Configure Your API

  • Under β€œConfigure APIs,” set the following details. The structure is similar to Postman for testing APIs:
    • API Name: This is the display name for the API, used for better readability within Cube6.
    • API Method: Specify the HTTP method (e.g., GET, POST, PUT).
    • Enter API URL: Provide the URL for the API you intend to call.
    • Query Parameters: Add any required query parameters.
    • Headers: Include necessary headers for the API.
    • Body: Define the request body if needed.
Note: If you want to insert custom variables within the API, use / as a placeholder. However, for the initial setup, you’ll need to enter the actual values to test the API and save the response structure.

Step 6: Test the API

  • Proceed to β€œManage API Response” and click on β€œTest” the API with actual values. This will help Cube6 understand the API response structure.

Step 7: Map API Response to Custom Attributes

  • In the β€œManage API Response” tab, you can map the API response variables to your Cube6 custom attributes.

Step 8: Replace Actual Values

  • If required, replace the actual values in your API configuration with the custom attributes that you’ve mapped.

Step 9: Access Your Chatflow

  • Navigate to your Bot’s chatflow by clicking on β€œEdit your Chatflow” under the β€œBots” section.

Step 10: Select the β€œAPI” Chat Component

  • In the list of chat components, choose the β€œAPI” chat component.

Step 11: Call the API

  • In the right panel, call the API by selecting the API you’ve configured earlier by its name.

Step 12: Map the next Questions

  • Map the next question based on your API’s response code (e.g., 200, 300, etc.). If the API response code doesn’t match any predefined values, it will trigger the response mapped to β€œothers.”
And you’re done! Your API is ready to enhance your chatbot’s functionality and provide dynamic interactions based on API responses.