feat: Replace mock WhatsApp with real Meta Graph API webhook
- POST /api/whatsapp/webhook handles Meta verification (hub.challenge) - Inbound text messages create tickets via create_ticket() - Auto-reply confirmation sent back via Meta Graph API - WhatsApp messages logged with ticket linkage in whatsapp_log - Added WHATSAPP_PHONE_NUMBER_ID, WHATSAPP_ACCESS_TOKEN, WHATSAPP_VERIFY_TOKEN config - Kept /mock-log debug endpoint for backward compatibility - Graceful degradation: logs message even if ticket/reply fails
This commit is contained in:
@@ -31,6 +31,12 @@ class Settings(BaseSettings):
|
||||
# ── CORS ─────────────────────────────────────────────────────────
|
||||
CORS_ORIGINS: str = "*"
|
||||
|
||||
# ── WhatsApp ─────────────────────────────────────────────────────
|
||||
WHATSAPP_PHONE_NUMBER_ID: str = ""
|
||||
WHATSAPP_ACCESS_TOKEN: str = ""
|
||||
WHATSAPP_VERIFY_TOKEN: str = ""
|
||||
META_GRAPH_BASE: str = "https://graph.facebook.com/v18.0"
|
||||
|
||||
# ── Paths ────────────────────────────────────────────────────────
|
||||
BASE_DIR: Path = Path(__file__).resolve().parent.parent.parent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user