Skip to main content

tungsten-whatsapp

WhatsApp for Tungsten leads (needs tungsten-leads).

Three ways to send

Way Setup What you get
Links only None The WhatsApp button on a lead opens WhatsApp (app or web) with the chat ready.
Cloud API (official) A Meta app with WhatsApp Send texts and approved templates from the panel, get replies, delivered and read ticks.
WhatsApp Web (linked phone) A WAHA gateway Send from your own WhatsApp number, linked by QR code. Get replies.

Everything sent and received shows on the lead's timeline and in WhatsApp chats. New chats can become leads by themselves, and new leads can get a welcome message (for example only leads from Facebook).

Install

pip install tungsten-whatsapp
from tungsten_leads import LeadsPlugin
from tungsten_whatsapp import WhatsAppPlugin

panel = Panel(..., app_url="https://admin.example.com")
panel.plugin(LeadsPlugin())
panel.plugin(WhatsAppPlugin())
panel.create_tables(engine)

Then open WhatsApp setup in the panel and press Setup guide. It walks through every click for each way, with your own addresses filled in. The full guide, with common problems, is also in WhatsApp.

Cloud API

  1. At developers.facebook.com, create an app with the use case Connect with customers through WhatsApp, and add your phone number in API Setup.
  2. Make a permanent token: Business settings, System users, add an Admin user, give it full control of the app and the WhatsApp account, and generate a token that never expires with whatsapp_business_messaging and whatsapp_business_management.
  3. In WhatsApp setup, pick Cloud API (official), fill in the Phone number ID, the WhatsApp Business Account ID, the token and the App secret, and save.
  4. Press More, Register number once, with a 6-digit PIN.
  5. In the Meta app, open Use cases, Customize next to WhatsApp, then Configuration. Paste the Callback URL and Verify token shown on the setup page, then subscribe to messages.
  6. Publish the app, add a payment method, and press Check connection.

WhatsApp only lets you send free text within 24 hours of the person's last message. Outside that window, use an approved template (press More, Sync templates to load them). Meta charges per message.

WhatsApp Web

  1. On a server with Docker, set up the free WAHA gateway with its compose file:
    mkdir waha && cd waha
    wget -O docker-compose.yaml https://raw.githubusercontent.com/devlikeapro/waha/refs/heads/core/docker-compose.yaml
    touch .env
    # change "image: devlikeapro/waha-plus" to "image: devlikeapro/waha" (ARM server: devlikeapro/waha:arm), then:
    docker compose run --no-deps -v "$(pwd)":/app/env waha init-waha /app/env
    docker compose up -d
    
    Copy the API key it prints.
  2. In WhatsApp setup, pick WhatsApp Web, fill in the gateway URL (http://127.0.0.1:3000 on the same server, else an https address in front of it) and the API key, and save.
  3. Press Link phone, then scan the QR code on your phone: WhatsApp, Linked devices, Link a device.

WhatsApp Web is not an official API. Message people who expect it and keep bulk sends small, or WhatsApp may block the number. Shared hosting can't run Docker, so the gateway needs a VPS; the panel itself can stay on shared hosting.

Metadata

Release files for tungsten-whatsapp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tungsten-whatsapp 0.1.0
File Size Uploaded
tungsten_whatsapp-0.1.0.tar.gz 32.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tungsten-whatsapp 0.1.0
File Interpreter ABI Platform
tungsten_whatsapp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.4 kB

Release files / tungsten_whatsapp-0.1.0.tar.gz

Download URL tungsten_whatsapp-0.1.0.tar.gz
Size 32.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9c88e3b5f9267b211f5c98f9f3f035e7801a9a54b5777a7c1c0fb17a621e21fc
BLAKE2b-256 checksum
How to use checksums
bba277cef501f54f81160783834734717c537af5729bbce788172e1e8d04e83a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / tungsten_whatsapp-0.1.0-py3-none-any.whl

Download URL tungsten_whatsapp-0.1.0-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7dbbaf17da4966d8d109251fe33d705605a92cb358edaf9e25103120760a132b
BLAKE2b-256 checksum
How to use checksums
1b89a6bff96c01d5b59fe09d08a0303ad7d2965698a84912fd664c161a88e35b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page