Integrate AI Agents with WhatsApp
Introduction
WhatsApp integration enables AI agents to interact directly with users through one of the world's most popular messaging platforms. This guide will walk you through the process of connecting your SipPulse AI agents with WhatsApp Business API, opening up new possibilities for automated customer engagement.
Prerequisites
- A SipPulse AI account with at least one configured agent
- A Meta Business Account
- A WhatsApp Business API account
- A verified business phone number
- An SSL-enabled webhook URL for receiving messages
Step-by-Step Integration Process
1. Setting Up WhatsApp Business API
- Navigate to the Meta Developer Portal (developers.facebook.com)
- Create a new app or select an existing one
- Add the WhatsApp Business API product to your app
- Complete the business verification process
- Configure your WhatsApp Business profile
2. Select a Phone Number
After completing this step, you can configure your required phone numbers in the WhatsApp section of your Facebook developer app. Upon successful completion, you should receive both a Phone Number ID and WhatsApp Business Account ID.
With these IDs, you can configure a webhook at SipPulse.AI. On the same page, you can create tokens for temporary 24-hour access. For a permanent token, you'll need to access system settings and create a token with appropriate permissions (more information available at https://developers.facebook.com/blog/post/2022/12/05/auth-tokens/).
Configure your data on SipPulse AI and set a token verification word. Then, go to the integrations page and create a new WhatsApp Integration.
3. Generating a System Token
- Access Meta Business Manager – Go to "Business Settings" > "Users" > "System Users"
- Click "Add" and create a new System User
- Set the role (Administrator is recommended for full access)
- Generate a token for this System User
- Select "Never" for token expiration
- Select the necessary permissions:
- whatsapp_business_management
- whatsapp_business_messaging
4. Create the Integration in SipPulse AI
5. Complete the Integration
In the advanced options, set the agent inactivity timeout. After a period without messages, the thread will be removed. You can also set a message to be sent if the integration is disabled. Additionally, you can set a thread shutdown message that will be sent when the thread is closed due to inactivity.
After completing the integration, create a webhook. When you save the integration page, you'll receive a webhook identification. Copy this URL to the webhook definition on Meta.
6. Configure the Callback
Configure the callback_url and verification token in the WhatsApp configuration.
Once your token is configured on SipPulse AI, the system is ready to send messages. With the callback_url configuration, it's also ready to receive messages. To test the integration, use your mobile phone to send a message to the phone number associated with the agent and check if you receive a response. If you encounter any issues, please contact our technical support through the Slack channel.
7. Test the System
Send a message to the configured phone number and wait for a response to verify the integration is working correctly.