Skip to main content

WhatsApp API SDK for Python — send messages, templates, media, and broadcasts

Project description

gaviwhatsapp

WhatsApp API SDK for Python. Send messages, templates, media, and broadcasts.

Install

pip install gaviwhatsapp

Quick Start

import os
from gaviwhatsapp import WhatsApp

wa = WhatsApp(api_key=os.environ["GAVIVENTURES_API_KEY"])

# Send a text message
wa.send(to="+919876543210", text="Hello!")

# Send a template message
wa.send_template(
    to="+919876543210",
    template="order_confirmation",
    variables={"1": "ORD-1234", "2": "$49.99"},
)

# Send media
wa.send_media(
    to="+919876543210",
    type="image",
    url="https://example.com/photo.jpg",
    caption="Your receipt",
)

# List templates
result = wa.get_templates()
print(result["templates"])

# Send broadcast
wa.broadcast(
    recipients=["+919876543210", "+919876543211"],
    template="promo_offer",
)

# Register webhook
webhook = wa.register_webhook(
    url="https://myapp.com/api/webhook",
    events=["message.received"],
)
print(webhook["secret"])  # Save for HMAC verification

API Reference

Method Description
wa.send(to, text) Send a text message
wa.send_template(to, template, language?, variables?) Send a template message
wa.send_media(to, type, url, caption?, filename?) Send media
wa.get_messages(phone?, limit?) Get message history
wa.get_templates(sync?) List available templates
wa.broadcast(recipients, template, language?, variables_per_recipient?) Send to multiple recipients
wa.register_webhook(url, events?) Register a webhook endpoint
wa.list_webhooks() List registered webhooks

Get an API Key

Sign up at gaviventures.com and go to Settings > API Keys.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gaviwhatsapp-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gaviwhatsapp-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file gaviwhatsapp-0.1.0.tar.gz.

File metadata

  • Download URL: gaviwhatsapp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for gaviwhatsapp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14182ed5ca783f854daeccecb2bfff2e2c47fd675b3d6396a8cb4260f34fb066
MD5 e23d5e7cd4f0a55de25006bed6e34b5e
BLAKE2b-256 174faf61b1e26f5f085eb9b091cd7f3cb6199a6a2e2d098a1dded5a189ec1da5

See more details on using hashes here.

File details

Details for the file gaviwhatsapp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gaviwhatsapp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for gaviwhatsapp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 281de756eff8726a889aa4a14f1574f75ae3eb9e6fdf5dfc59c62a8397d946f1
MD5 109e3b3c94988999be200094e0bae2f4
BLAKE2b-256 783ebbb0178b0cb98f448701210c33d207e15db9aee6639ee6b02109fec28de0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page