WhatsApp Gateway API

Security note: Keep your API key private. This docs page intentionally shows a dummy key (XXXXXXX).

Base URL: http://whatsapp.appconfig.pro

Status right now: connected = false, queue = 0

Endpoints

GET /status

Check gateway status + QR (when not connected).

Response JSON:

{
  "connected": true|false,
  "qr": "data:image/png;base64,..." | null,
  "queue": number,
  "webhook": "https://..." | null
}

Example:

curl http://whatsapp.appconfig.pro/status

POST /send (TEXT)

Queue and send a WhatsApp text message.

Body JSON:

{
  "secret": "XXXXXXX",
  "phone": "9199XXXXXXXX",
  "message": "Hello!"
}

Note: phone should be digits only. Server auto adds @c.us.

Response:

{ "status": "queued", "type": "text" }

Example:

curl -X POST http://whatsapp.appconfig.pro/send \
  -H "Content-Type: application/json" \
  -d '{"secret":"XXXXXXX","phone":"9199XXXXXXXX","message":"Hello from gateway"}'

POST /send (FILE URL: pdf/image/audio/video)

Send media from a public URL (PDF, image, audio, video). This downloads the file on server and sends it.

Body JSON:

{
  "secret": "XXXXXXX",
  "phone": "9199XXXXXXXX",
  "fileUrl": "https://example.com/invoice.pdf",

  "message": "Optional caption (used if caption not provided)",
  "caption": "Optional caption (preferred)",
  "mimeType": "Optional e.g. application/pdf",
  "fileName": "Optional e.g. invoice.pdf"
}

Notes:
• If fileUrl is provided, server sends media.
caption is optional. If caption is empty, it uses message as caption.
mimeType and fileName are optional.

Response:

{ "status": "queued", "type": "media" }

Example:

curl -X POST http://whatsapp.appconfig.pro/send \
  -H "Content-Type: application/json" \
  -d '{"secret":"XXXXXXX","phone":"9199XXXXXXXX","fileUrl":"https://example.com/invoice.pdf","caption":"Invoice attached"}'

POST /check

Check if a number is registered on WhatsApp.

Body JSON:

{
  "secret": "XXXXXXX",
  "phone": "917755056640"
}

Response JSON:

{
  "ok": true,
  "phone": "917755056640",
  "chatId": "917755056640@c.us",
  "exists": true|false
}

Example:

curl -X POST http://whatsapp.appconfig.pro/check \
  -H "Content-Type: application/json" \
  -d '{"secret":"XXXXXXX","phone":"917755056640"}'

POST /config

Set webhook URL (saved in saved_config.json).

Body JSON:

{
  "apiKey": "XXXXXXX",
  "webhookUrl": "https://yourdomain.com/whmcs/callback.php"
}

Response:

{ "status": "saved", "webhook": "https://..." }

Example:

curl -X POST http://whatsapp.appconfig.pro/config \
  -H "Content-Type: application/json" \
  -d '{"apiKey":"XXXXXXX","webhookUrl":"https://yourdomain.com/modules/addons/wa_notify_pro/callback.php"}'

POST /logout

Logout WhatsApp session + delete session folder + restart client (forces new QR).

Body JSON:

{
  "secret": "XXXXXXX"
}

Response:

{ "status": "ok", "message": "Logout process started" }

Example:

curl -X POST http://whatsapp.appconfig.pro/logout \
  -H "Content-Type: application/json" \
  -d '{"secret":"XXXXXXX"}'

Optional QR endpoints

GET /qr

Shows QR on a simple HTML page.

http://whatsapp.appconfig.pro/qr

GET /qr.png

Returns QR as PNG image.

http://whatsapp.appconfig.pro/qr.png

Incoming webhook (to your WHMCS)

When a user sends a WhatsApp message to your number, this gateway sends a POST to your webhook URL with:

{
  "action": "incoming_message",
  "phone": "countrycode+number",
  "message": "text",
  "secret": "XXXXXXX"
}

Gateway is running. Refresh this page any time.