With BotGenius, 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 BotGenius and external platforms for tasks such as data retrieval, form submissions, user updates, and more.
BotGenius HTTP API integration is a versatile feature that enables seamless integration with external platforms like WooCommerce and WordPress. Whether you want to display WooCommerce products in WhatsApp or integrate WordPress posts with WhatsApp, we’ve got you covered with step-by-step guides:
Here’s a step-by-step guide on how to set up and integrate an HTTP API.
Step 1: Access the HTTP API Section
- From the BotGenius 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.
- 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:
- API Name: Provide a recognizable name for your API connection (e.g., “WordPress User Create”).
- Method: Select the appropriate HTTP method (e.g., POST, GET) that matches the external API’s requirements.
- 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
). - 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:
- Content-Type: Set this to
application/json
or another content type, depending on the API specifications. - 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
- Example:
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:
- 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
, andemail
. - You can define whether each field is a static value (fixed value) or dynamic value (pulled from user input or external data).
- For instance, in the screenshot, the body includes user data such as
- 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:
- Click on the “Verify Connection” button. BotGenius will send a test request to the external API to ensure everything is configured correctly.
- 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:
- HTTP API Response Mapping: This section allows you to map fields from the API’s response to subscriber data or other variables within BotGenius.
- For example, if the API returns a
user_id
oremail
, you can map this back to the subscriber’s profile in BotGenius. - You can also save List Items. It will be saved as JSON.
- For example, if the API returns a
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.
- HTTP API Element : Inside the Flow Builder, You can add HTTP API Element anywhere you want.
- 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 BotGenius workflows, allowing for actions such as creating users, retrieving subscriber data, or updating external systems directly from your BotGenius 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.
0 Comments