Prerequisites
Set up a Meta Developer App
Set up a Meta Developer App
- Go to the Meta Developer Portal and create a developer account.
- Create a new Business app at the Apps Dashboard.
- Add the WhatsApp product to your app from the app dashboard.
- In WhatsApp > API Setup, note your Phone Number ID and generate an Access Token.
Configure environment variables
Configure environment variables
For first-time outreach to a user, you must use pre-approved message templates. Test messages can only be sent to numbers registered in your test environment.
Example
The following agent sends a template message via WhatsApp:cookbook/91_tools/whatsapp_tools.py