WhatsApp API Bot with a Flask server, launched using ngrok.
- Initial webhook configuration and token verification with Meta.
- Incoming messages - server marks the incoming message as "read" and responds with a default greeting text message.
- Prints status updates for sent messages (e.g. "delivered", "read" etc.)
- WHATSAPP_TOKEN - (temporary) Meta access token (can be found inside the "API Set Up" section on the Meta for Developers website).
- VERIFY_TOKEN - your own verification token to be used for the webhook configuration (can be any string).
- GRAPH_BASE_API - base API url (currently version 17 is used - https://graph.facebook.com/v17.0/).
- PHONE_NUMBER_ID - your sender WhatsApp phone number id.
Flask main app with all of the server endpoints.
Handles the initial webhook set up and token verification logic for GET requests to /mywebhook endpoint.
Handles webhook notifications for POST requests to /mywebhook endpoint.
Handles logic for text messages.