hexabot-channel-whatsapp
v2.2.3
Published
WhatsApp Channel Extension for Hexabot Chatbot Builder
Readme
Hexabot WhatsApp Channel Extension
The WhatsApp Channel Extension for Hexabot enables seamless integration of your Hexabot chatbot with WhatsApp-related business assets, such as WhatsApp Business Accounts and message templates.
Hexabot is an open-source chatbot/agent solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots with ease. Learn more about Hexabot on the official GitHub repository.
Features
- Media Messages: Send files, images, and locations.
- Interactive Messages: Simplify responses with:
- Quick Replies: Offer predefined response options for faster interactions.
- Attachments: Enrich conversations with media (images, videos, files, etc.).
- List Messages: Present users with selectable options for structured responses.
Prerequisites
Before getting started, ensure you have the following:
- A Facebook account.
- A Meta Developer Account: Register here.
- An App: Create one here.
- Basic knowledge of APIs and web development (optional but helpful).
- A server to host your chatbot (local servers can use ngrok or similar API gateways for testing).
- HTTPS enabled on your server (required for webhooks).
- A new or existing Hexabot project.
Setup Guide
Step 1: Create a Meta Developer Account
- Access Meta for Developers:
- Visit Meta for Developers.
- Log In:
- Click "Get Started" and log in using your Facebook credentials.
- Register as a Developer:
- Accept the Meta Platform Policies.
- Complete any additional verification steps, such as phone verification.
- Access the Developer Dashboard:
- After registering, you’ll be redirected to the Developer Dashboard, where you can manage your apps.
Step 2: Create an APP
- Navigate to your app list on the **Apps** screen.
- **Create a new app**.
- Choose a **name** for your new app.
- Choose **Other** for your app use case
- Choose **Business** as type for your app.
- Submit your request and now you'll see your newly created app in your list of applications.Step 3: Add the WhatsApp Product to Your App
- Add WhatsApp to Your App:
- If creating a new app, select "Add products to your app".
- For existing apps, navigate to your app on the My Apps screen.
- Attach a Meta Business Account (MBA):
- You’ll be prompted to attach an MBA. If you don’t have one, follow the prompts to create it.
Step 4: Add a Recipient Number
- Navigate to WhatsApp API Setup:
- In the App Dashboard, go to WhatsApp > API Setup.
- Add a Phone Number:
- Under Send and Receive Messages, click Manage Phone Number List and add a valid WhatsApp number.
- Send a test message:
- Under Step2: send messages with API, click Send a message and then your'll receive a message on your WhatsApp number.
- You will need to accept/allow messages from the test number.
Step 5: Generate an Access Token
- Select Your App:
- In the App Dashboard, go to WhatsApp > API Setup.
- Generate Token:
- Click "Generate Token" to create a temporary token.
- Copy and store the token securely. This token is required for your backend.
Important : Learn how to create a permanent token
Step 6: Set Up a Webhook
Webhooks enable real-time updates from WhatsApp to your chatbot.
- Provide a Webhook URL:
- In WhatsApp > Configuration, enter your server's webhook URL.
- Example:
https://your-domain.com/webhook/whatsappor if running in production behind NGNIX using method 1 'https://your-domain.com/api/webhook/whatsapp'
- Example:
- In WhatsApp > Configuration, enter your server's webhook URL.
- Set a Verification Token:
- Create a secure token to verify the webhook.
- Choose Subscription Fields:
- Select events to subscribe to, such as messages.
- Verify and Save:
- Meta will send a verification request to your callback URL. Ensure your server responds correctly to complete the setup.
Configuration
To configure the WhatsApp Channel Extension, you’ll need the following:
1. Webhook Verification Token
- Description: A secure token used by WhatsApp to verify your webhook.
- Setup:
- Generate a token and configure it in both Hexabot and WhatsApp settings.
2. WhatsApp Access Token
- Description: Grants your app access to the WhatsApp Business API.
- Setup:
- In the Developer Dashboard, go to WhatsApp > Configuration.
- Generate the token and add it to your Hexabot configuration.
3. Facebook App Secret
- Description: A secret key for securing communication between WhatsApp and your chatbot.
- Setup:
- Navigate to App Settings > Basic in the Developer Dashboard to retrieve the App Secret.
- Store this value securely.
Usage
Once the extension is installed and configured, your Hexabot chatbot will be available on WhatsApp. Users can interact with your bot, leveraging features such as:
- Media messages
- Quick replies
- Interactive lists
Note
Currently, WhatsApp does not support URL buttons natively. As a workaround, we handle scenarios with a single URL button by leveraging WhatsApp's "Call to Action" (CTA) component.
For cases requiring multiple URL buttons, you can create a specific flow tailored to the WhatsApp channel. This flow involves sending successive messages, each containing a single URL button attached as a CTA. By structuring your flow this way, you ensure that all URL buttons are presented effectively while adhering to WhatsApp's limitations.
Contributing
We welcome contributions from the community! Whether you want to report a bug, suggest new features, or submit a pull request, your input is valuable to us.
Please refer to our contribution policy first : How to contribute to Hexabot
Feel free to join us on Discord
License
This software is licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
- The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
- All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
Happy Chatbot Building!
