Handling Twilio Studio Flow logic and Twilio API Logic in Python Flask Application

23 Views Asked by At

I have built a Flask Application using the Twilio Messaging API for WhatsApp. The application is a chatbot that I host on my company's in-house server. I expose the application endpoint via a web hook to Twilio to handle conversations which are user initiated.

My issue is that I am trying to create a survey (business initiated) as a separate flow in Twilio Studio. When I call this flow via it's REST API endpoint, it triggers the survey, but somehow the inbound message (response from the user) is still sent to the logic in the Flask Application. I know that my 'Senders' is set to the Flask Application Web hook at the moment. However, any response from the user survey is then not following the Studio Flow logic.

How do I separate the flow logic from the Flask application logic? I have been looking into per-service web hooks, conversations scoped web hooks, etc., but I am struggling to understand where exactly I need to configure this action in Twilio Studio/Console, or how to configure it in the Flask application logic.

0

There are 0 best solutions below