Connecting WhatsApp Flows to an Endpoint
How to Connect WhatsApp Flows to an Endpoint
Overview of the Appointment Booking Flow
- The video demonstrates how to connect WhatsApp flows to an endpoint, specifically using the appointment booking flows template. This allows for dynamic population of appointment locations and times based on availability.
- A fully working example of the endpoint code is available on GitHub, with options to fork and edit it directly in Glitch.
Setting Up the Endpoint
- The main file controlling user interactions is
flows.js, which manages screen displays and data responses. Mock data for each screen is generated from the Flows Builder interface.
- The function
getNextScreendetermines which screen appears next, while theinitaction indicates initial requests when users open flows.
Connecting Endpoint to Flows
- After running the endpoint and obtaining a public URL, users return to Flows Builder to connect their endpoint by entering this URL.
- Users must select a metadata developer app linked to their flows after uploading their public key. A health check request verifies that the endpoint is operational and encryption is correctly implemented.
Previewing Flows with Endpoint
- To preview flows connected with the endpoint, users enable interactive preview mode in settings and select their desired phone number.