integrations/whatsapp/hub.md
The WhatsApp integration allows your AI-powered chatbot to seamlessly connect with WhatsApp, one of the most popular messaging platforms worldwide. Integrate your chatbot with WhatsApp to engage with your audience, automate conversations, and provide instant support. With this integration, you can send messages, handle inquiries, deliver notifications, and perform actions directly within WhatsApp. Leverage WhatsApp's powerful features such as text messages, media sharing, document sharing, and more to create personalized and interactive chatbot experiences. Connect with users on a platform they already use and enhance customer engagement with the WhatsApp Integration for Botpress.
Previously, accessing the content of media messages (such as images, videos, audio and documents) required authenticating with the WhatsApp API using a valid token. In version 4.0 of WhatsApp, the Download Media parameter enables automatic downloading of media files. These downloaded files do not require authentication for access. However, they do count against your workspace's file storage. To continue using the WhatsApp API URLs, set the Download Media parameter to disabled. The Downloaded Media Expiry parameter allows you to set an expiry time for downloaded files.
In version 4.0 of WhatsApp, all incoming button and list reply messages will include both the text displayed to the user (text) and the payload (value). Use event.payload.text to retrieve the label of a button or choice, and use event.payload.value to access the underlying value.
In version 4.0 of WhatsApp, postback and say messages no longer use the prefixes p: or s:. If your bot relied on these prefixes for logic or transitions, you can update it to depend solely on the value set for the postback.
Version 4.0 of WhatsApp introduces small changes in the call signature of the startConversation action:
senderPhoneNumberId parameter has been renamed to botPhoneNumberIdconversation, which contains the actual argumentsIf your bot used the startConversation action, make sure all parameters are set. Also, if you called startConversation from code, make sure the action is called with the correct arguments:
actions.whatsapp.startConversation({
conversation: {
userPhone: '+1 123 456 7890',
templateName: 'test_message',
templateLanguage: 'en',
templateVariablesJson: JSON.stringify(['First value', 'Second value'])
botPhoneNumberId: '1234567890'
}
})