Content mapping for the official WhatsApp integration.
event
’s properties. This is useful if you want to store user-provided data and access it later.
Here’s a breakdown of how data from WhatsApp is mapped to Botpress:
WhatsApp Message Type | Botpress Type | How to Read |
---|---|---|
Text messages | text | event.preview or event.payload |
Choices from interactive buttons or lists | text | event.preview or event.payload |
Image messages | image | event.payload |
Sticker messages | image | event.payload |
Audio messages | audio | event.payload |
Video messages | video | event.payload |
Document messages | file | event.payload |
Location messages | location | event.payload |
event.payload
:
event.type
is equal to the data type you’re expecting from the user.event.payload
.Text
Image
Audio
Video
{{event.payload.imageUrl}}
to get the image.
Get raw file content from the WhatsApp API
WHATSAPP_ACCESS_TOKEN
.GET
request to get the raw file data:<URL>
with the actual URL provided in the payload
whatsappAccessToken
as a Bearer
token in the HTTP Authorization
header
event
tags to get information about the current WhatsApp user and conversation:
event.tags.conversation['whatsapp:userPhone']
This number contains the country code. It has no spaces, dashes (-) or symbols.
event.tags.conversation['whatsapp:botPhoneNumberId']
This is useful if you have multiple phone number IDs pointing to the same bot.
event.tags.message['whatsapp:replyTo']
If the message is a reply, the tag’s value will be the Botpress messageId
of the quoted message.