Menu

Adding a diagnostic WhatsApp status endpoint to a Next.js API (`app/api/whatsapp/estado/route.ts`)
📰

Adding a diagnostic WhatsApp status endpoint to a Next.js API (`app/api/whatsapp/estado/route.ts`)

DEV Community: productivity·Roberto Luna·1 day ago
#vZzrnmmO
Reading 0:00
15s threshold

Adding a diagnostic WhatsApp status endpoint to a Next.js API ( app/api/whatsapp/estado/route.ts )

TL;DR: I added a new admin‑only endpoint ( /api/whatsapp/estado ) that returns the health of our WhatsApp Business API client and automatically subscribes the webhook if needed. The change also fixed a routing conflict that was causing every /api/whatsapp/* request to return 404.

The Problem

Our ticketing platform albaida‑tickets relies on a WhatsApp Business API client to receive voice notes from residents. The client runs in production behind a webhook that forwards incoming messages to our backend.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.