Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

WhatsApp Business API Client

Project description

This work is extracted from Praekelt PBC’s work on MomConnect and WhatsApp. See the blog post for more details.

This does not work with a normal WhatsApp account, only the WhatsApp Business API.

Also has some support for creating message templates and sending message templates in bulk.

$ pip install wabclient[cli]
$ wabclient create --help
$ wabclient create \
    --number <your number without leading + like `27123456789`> \
    --token <your auth token> \
    --name <template name> \
    --template <template>

$ wabclient send --help
$ wabclient send \
    --csv-file wa_ids.csv \
    --token your-auth-token \
    --namespace the-namespace \
    --name the-element-name \
    --rate-limit 60\60 \
    --param "the first HSM template default param" \
    --param "the second HSM template default param"

The CSV file should list the WA ids, one per line. WA ids are generally in the E.164 format without a leading plus. If you’re getting errors adding the –debug flag will print the JSON error response from the API to stderr.

For WA ids that were sent to successfully will be print in green to stdout, WA ids that are invalid will print to stderr in red.

Project details

Download files

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

Files for wabclient, version 2.3.3
Filename, size File type Python version Upload date Hashes
Filename, size wabclient-2.3.3-py3-none-any.whl (17.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size wabclient-2.3.3.tar.gz (15.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page