https://discord.gg/botpress logo
#🤝help
Webhook set-up in Twilio
# 🤝help
t

tall-tiger-81408

01/08/2024, 6:30 PM
Hi! I'm creating 3 separate chatbots using Botpress and Twilio. I aim to direct incoming messages to a specific chatbot based on the initial text sent by the user, for example: "Bot1", "Bot2" or "Bot3". I need to set-up 3 different webhooks for each chatbot so I try to make it using workflows in Twilio. As of now I have a problem with set-up the first one. I get an error code (below) when sending SMS to my Twilio numer. Please find the screenshot with the current HTTP request attached. I think that there is a mistake in "Request Body" part, so JSON is wrong, but I'm not sure why. Error code: {"id":"err_20240107172755x0EE3097A","code":500,"type":"Unknown","message":"Request failed with status code 502 (Error ID: err_20240107172755x0EE3097A)"} I will appreciate any help!
b

bumpy-addition-21507

01/08/2024, 6:35 PM
is that the number Twilio gives you to test or one you are paying?
t

tall-tiger-81408

01/08/2024, 7:54 PM
It's the one i'm paying for.
a

aloof-spring-75081

01/08/2024, 11:17 PM
Hi Piotr! I am also getting this vague webhook response today in my application. I am trying to debug now and will let you know if I find anything helpful!
t

tall-tiger-81408

01/09/2024, 7:05 PM
Hi Alex! Perfect, I will appreciate any help with it!
e

early-train-33247

01/09/2024, 7:17 PM
Hello @tall-tiger-81408, have you added a secret in the Webhook integration settings? If so, you have to pass a header
x-bp-secret
with the secret value
t

tall-tiger-81408

01/09/2024, 9:15 PM
Hello Guilhermy, thanks for your message. No I have not added a secret, I left it as it was default.
a

aloof-spring-75081

01/09/2024, 10:18 PM
Any progress on this @tall-tiger-81408 ? I solved my bug, it had to do with formatting of the request payload- I was using the python requests library instead of axios and there were a few differences. Make sure your request payload isn't being parsed multiple times anywhere, and double check that it's valid JSON... but from your pic it looks correctly formatted.
t

tall-tiger-81408

01/10/2024, 10:30 AM
I asked Twilio support to take a look on the existing workflow and for letting me know if my JSON is not parsed multiple times as you @aloof-spring-75081 have advised (thanks for that!). I will let you know if I will get any updates 🙂
Oh, and they send me back to Botpress support 😅
e

early-train-33247

01/12/2024, 7:33 PM
Hey @tall-tiger-81408 sorry that you are having this issue! The error 502 indicates that there's something wrong with the request, maybe the payload is invalid or the Webhook integration is not installed/enabled
Try deleting the Webhook integration and installing it again from the Hub