Twilio Integration - Files Receiving
# 🤝help
b
Hi everyone, I'm integrating Botpress with WhatsApp through Twilio, but it seems that the current Twilio integration doesn't handle file receiving. I'm looking to manage this myself using an Execute Code card. However, my issue is that
event.payload
is empty when I send a file in WhatsApp, despite Twilio sending all necessary data to Botpress's webhook. The payload sent by Twilio looks like this:
Copy code
{
  "MediaContentType0": "image/jpeg",
  "NumMedia": 1,
  "MessageType": "image",
  "WaId": "0000000",
  "SmsStatus": "received",
  "Body": "",
  "To": "whatsapp:+000000000",
  "NumSegments": 1,
  "ReferralNumMedia": 0,
  "From": "whatsapp:+0000000",
  "MediaUrl0": "https://api.twilio.com/2010-04-01/Accounts/...",
  "ApiVersion": "2010-04-01"
}
So my question is, how can I capture, for example, the
MediaUrl0
in my code?
f
Hi, Yes we don't support that currently. However, we support it in the direct integration: https://botpress.com/docs/cloud/channels/whatsapp/#media-images-audio-documents
b
Thank you for the response. The problem with the direct integration is that it uses Meta's Cloud API, and currently, Meta has restrictions for sending/receiving messages from/to Turkey phone numbers. As a result, Botpress's WhatsApp integration is not an option for me, and I have to integrate through Twilio, as they offer On-Promise API for WhatsApp integration. Is there a way to access all the payload that was sent by Twilio in the Execute Code card? Or is there any other solution that could work?
f
What would you like to do with the image?
b
Having the image URL, I will make an API request to my server and send the image along with additional user-provided information to the support team via email.
Currently, my setup is pretty simple. I have a "Wait for User Input" card followed by an "Execute Code" card where I try to capture the payload sent by Twilio. But as I mentioned above
event.payload = { "text": "" }
and
event.preview
is empty https://cdn.discordapp.com/attachments/1224075955102941236/1224602083408351322/Screenshot_1.png?ex=661e1690&is=660ba190&hm=18dee50f183059847c6930973a4cf978c16089faa9c7e9d5b54133c0b3e96c86&