Python wrapper for the Meta WhatsApp API
Project description
WhatsApp API
A Python wrapper for the Meta WhatsApp Business API. This package allows developers to interact with the WhatsApp Business API for sending messages, buttons, and list messages.
Documentation
For detailed usage instructions, examples, and validation rules, check out the full documentation:
Installation
Clone the Repository
- Clone the repository:
git clone https://github.com/mahiuddin-dev/whatsapp-api-wrapper cd whatsapp-api-wrapper
Create and Activate a Virtual Environment
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install Dependencies
- Install dependencies:
pip install -r requirements.txt
Configuration
Create a .env File
-
Create a
.envfile in the root directory:touch .env -
Add the following environment variables to the
.envfile:WHATSAPP_ACCESS_TOKEN=your_access_token_here WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id_here TEST_RECIPIENT_PHONE_NUMBER=recipient_whatsapp_number_here
Replace the placeholders with your actual values.
Example: Sending a Text Message
from whatsapp_api.message.messaging import MessagingClient
client = MessagingClient(access_token, phone_number_id)
response = client.send_text_message(recipient_phone_number, "Hello from WhatsApp API!")
print("Response:", response)
Contributing
Contributions are welcome! If you have ideas or improvements, feel free to open a pull request or an issue.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whatsapp_api_connect-0.0.7.tar.gz.
File metadata
- Download URL: whatsapp_api_connect-0.0.7.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b01e488ece5d4007717b15ea654159182356defbe40ed0c00caf46a9b6118a11
|
|
| MD5 |
83a980065fe028884e358738630c3c07
|
|
| BLAKE2b-256 |
7b013fa0f77d225c9d01d0a8e8ed8e27d12418768fde863bbbdacb59d8aa33e9
|
File details
Details for the file whatsapp_api_connect-0.0.7-py3-none-any.whl.
File metadata
- Download URL: whatsapp_api_connect-0.0.7-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ccf3ed2a4a0a58f0dc56627780d59a792b511df1d9c8b239c05bb1f8854a8a
|
|
| MD5 |
4930d3a8ccf2f353417ad9b677165fb5
|
|
| BLAKE2b-256 |
6deef6cf9df5c3fc6b868e95d0113676ad4ca446969d4d6b1e4dccdc83705875
|