WhatsApp API Python Module
A Python module for sending WhatsApp messages using a third-party API.
Installation
Install the module using pip:
pip install whatsapp-api
Usage
from whatsapp_api import WhatsAppAPI
Example usage
your_id = 'your_id'
api_key = 'your_api_key'
whatsapp = WhatsAppAPI(your_id, api_key)
# Sending a simple text message
result = whatsapp.send_simple_text_message('recipient_number', 'Hello, this is a test message')
print(result)
# Sending media from URL
result = whatsapp.send_media_from_url('recipient_number', 'media_url', 'Optional caption')
print(result)
# Sending text in a group
result = whatsapp.send_text_in_group('group_name', 'Hello, this is a group message')
print(result)
# Sending media in a group from URL
result = whatsapp.send_media_from_url_in_group('group_name', 'media_url', 'Optional caption')
print(result)
API Methods send_simple_text_message(number, message) Send a simple text message to the specified number.
number: Recipient's phone number. message: Text message to be sent. send_media_from_url(number, url, caption='') Send images/PDF/documents, etc., from a URL to the specified number.
number: Recipient's phone number. url: URL of the media file. caption (Optional): Caption for the media file. send_text_in_group(group_name, message) Send a text message to a WhatsApp group.
group_name: Name of the WhatsApp group. message: Text message to be sent. send_media_from_url_in_group(group_name, url, caption='') Send images/PDF/documents, etc., from a URL to a WhatsApp group.
group_name: Name of the WhatsApp group. url: URL of the media file. caption (Optional): Caption for the media file. License This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for onyx-whatsapp-api 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onyx-whatsapp-api-0.1.1.tar.gz | 2.3 kB | Without provenance | Details for onyx-whatsapp-api-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onyx_whatsapp_api-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for onyx_whatsapp_api-0.1.1-py3-none-any.whl |
Total release size: 5.4 kB
Release files / onyx-whatsapp-api-0.1.1.tar.gz
| Download URL | onyx-whatsapp-api-0.1.1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4527ed64e46aa89e9e03aabf5800560255da52909f46c38d8c7603b7edade01e
|
|
BLAKE2b-256 checksum How to use checksums |
15f11fd2faf5c0222ff1adb1fb319fdf2b6beee94be8f79471d27de7dd65fe37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / onyx_whatsapp_api-0.1.1-py3-none-any.whl
| Download URL | onyx_whatsapp_api-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b27eb93036e3d1a9dbb93d98b1a071c27f4185e408b5bffd3b1a01d1453a96e7
|
|
BLAKE2b-256 checksum How to use checksums |
78239e5c875d36500fb8a9b993aeb66d3cbec22c470d2675acc7b6b7913e0d99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for onyx-whatsapp-api 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.