gerandonk/apiwhatsapp

By gerandonk

Updated about 2 months ago

Unofficial Whatsapp Gateway Using NodeJs

Image
Message queues
0

807

gerandonk/apiwhatsapp repository overview

Headless Multi Session WhatsApp Gateway

A headless multi-session WhatsApp gateway with multi-device support, easy to set up using Docker.

  • Multi-device support
  • Multi-session / multiple phone numbers
  • Send text messages, images, and documents
  • Webhook integration

📌 Also see: wa-multi-session


⚠️ Prerequisites


Installation & Running

1. Create Application Folder

Create a new folder for your application at ~/app/wa-gateway and navigate into it:

mkdir -p ~/app/wa-gateway
cd ~/app/wa-gateway
2. Create docker-compose.yaml

Use the nano editor to create the file:

nano docker-compose.yaml

Paste the following content into the editor to create docker-compose.yaml

# docker-compose.yaml
services:
  wa-gateway:
    container_name: "wa-gateway"
    image: gerandonk/apiwhatsapp:latest
    volumes:
      - ./wa_credentials:/app/wa_credentials
    ports:
      - "5001:5001"
    environment:
      - KEY= # make your own api key (optional)
3. Start the container

Run the following command in the same directory as your docker-compose.yaml:

docker compose up -d
4. Open Browser & Scan QR Code

Visit this URL to scan the QR code from your WhatsApp device:

http://localhost:5001/session/start?session=mysession

Replace localhost with your server's IP or domain if not running locally.

Replace mysession with your desired session name.

5. Send Your First Message

Example to send a text message:

http://localhost:5001/message/send-text?session=mysession&to=628123456789&text=Hello

For PHPNuxBill:

http://localhost:5001/message/send-text?session=mysession&to=[number]&text=[text]

API Reference

All API endpoints remain the same as the NodeJS version. Here's a quick reference:

Create New Session
GET /session/start?session=NEW_SESSION_NAME

or

POST /session/start
{
  "session": "NEW_SESSION_NAME"
}
Send Text Message
POST /message/send-text

Body fields:

FieldTypeRequiredDescription
sessionstringYesThe session name you created
tostringYesTarget phone number (e.g. 628123456789)
textstringYesThe text message
is_groupbooleanNoTrue if target is a group
Send Image
POST /message/send-image

Body includes all of the above plus image_url.

Send Document
POST /message/send-document

Body includes:

  • document_url
  • document_name
Delete Session
GET /session/logout?session=SESSION_NAME

Webhook Setup

To receive real-time events, set your webhook URL using the environment variable:

WEBHOOK_BASE_URL="http://yourdomain.com/webhook"

Example webhook endpoints:

  • Session: POST /webhook/session
  • Message: POST /webhook/message

Access Media Files

Media files are stored inside the ./media directory in the container. You can access them via:

http://localhost:5001/media/FILE_NAME

Upgrading

To update to the latest version:

cd ~/app/wa-gateway
docker compose pull
docker compose down
docker compose up -d

Documentation

For full documentation, examples, and guides, visit: 👉 https://github.com/mimamch/wa-gateway


Let me know if you need configuration examples with environment variables (like webhook setup) or a multi-service deployment!


Donation:

https://paypal.me/sklitinov⁠

https://viaqris.gmcloud.xx.kg/⁠

Tag summary

Content type

Image

Digest

sha256:188a76de5

Size

48.4 MB

Last updated

about 2 months ago

docker pull gerandonk/apiwhatsapp:v2