image
1053
blog

With BotSailor, you can integrate external APIs and incorporate them into the Flow Builder to enhance the capabilities of your chatbot automation. This feature allows for a seamless connection between BotSailor and external platforms for tasks such as data retrieval, form submissions, user updates, and more.

Here’s a step-by-step guide on how to set up and integrate an HTTP API in BotSailor:


Step 1: Access the HTTP API Section

  1. From the BotSailor dashboard, navigate to the "WhatsApp HTTP API" section From Integration-> HTTP API . This is where you can view your current API connections and add new ones.
  2. Click on the "Create" button to start setting up a new API connection.

Step 2: Add API Connection Details

In this section, you will configure the API settings to connect with external services:

  1. API Name: Provide a recognizable name for your API connection (e.g., "WordPress User Create").
  2. Method: Select the appropriate HTTP method (e.g., POST, GET) that matches the external API’s requirements.
  3. Endpoint URL: Enter the full URL of the external API that you want to connect to (e.g., https://example.com/api/v1/users/create).
  4. Test Subscriber ID:  Put a subscriber id copying from subscriber manager. Use your own phone number subscriber id. This is actually used for calling the API during verification. As some data may needed for dyanmic to pass custom field data or system field data. So for this test purpose at the first time, just put a testing subscriber ID.

Step 3: Configure Request Headers

In this section, you need to define any required HTTP headers needed to make the API request:

  1. Content-Type: Set this to application/json or another content type, depending on the API specifications.
  2. Authorization: If the API requires authorization (e.g., Basic Auth, Bearer Token), add the relevant header with the necessary token or credentials.
    • Example: Authorization: Bearer


Step 4: Configure Request Body (Optional)

If the API request requires data to be sent in the body (for POST/PUT requests), configure the fields here:

  1. Body Data Fields: Add the necessary fields for the API request.
    • For instance, in the screenshot, the body includes user data such as username, first_name, last_name, and email.
    • You can define whether each field is a static value (fixed value) or dynamic value (pulled from user input or external data).
  2. You can switch between form data, X-WWW-FORM-URLENCODED, and raw formats depending on the API requirements.


Step 5: Save and Verify the Connection

Once you have entered all the required fields:

  1. Click on the "Verify Connection" button. BotSailor will send a test request to the external API to ensure everything is configured correctly.
  2. Once verified, click Save API to finalize the connection.

Step 6: Map API Response Data

After a successful API connection, you can map the response data back into your workflow:

  1. HTTP API Response Mapping: This section allows you to map fields from the API’s response to subscriber data or other variables within BotSailor.
    • For example, if the API returns a user_id or email, you can map this back to the subscriber’s profile in BotSailor.

Step 7: Use in Flow Builder

Once your API is integrated and the response mapping is set up, you can now use this API connection within your Flow Builder to trigger API calls at different points in your chatbot’s conversation flow.

  1. HTTP API Element : Inside the Flow Builder, You can add HTTP API Element anywhere you want.
  2. Configure when and how the API should be called based on user interactions.


Summary

With this setup, you can fully integrate external APIs into your BotSailor workflows, allowing for actions such as creating users, retrieving subscriber data, or updating external systems directly from your BotSailor chatbot flows.

For more detailed documentation on each API connection step or advanced settings, feel free to consult our support team or visit the help center.


Related Topics :

 How to Integrate WordPress with WhatsApp via BotSailor's API 


image

BotSailor

5 Oct 2024
  • Categories :

  • How to

(0) Comments

Related Articles

Stay ahead of the curve with BotSailor`s latest articles. Dive into expert analyses, industry trends, and actionable tips to optimize your experience. Explore our articles now and unlock the full potential of your business.

blog

How to set up the WhatsApp Cloud API with BotSailor

BotSailor is a complete WhatsApp marketing automation; it has chatbot, live chat, broadcasting, Shopify & WooCommerc...

READ MORE
blog

Send WooCommerce Order Notifications to WhatsApp by BotSailor Webhook Workflow

You can send Woocommerce Order Notifications to customers via WhatsApp by BotSailor in a very easy and straightforward w...

READ MORE
blog

BotSailor’s Affiliate Program

We're delighted to announce the opening of the BotSailor Affiliate Program today! We developed it as a way to thank the ...

READ MORE