Skip to main content

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

  1. Clone the repository:
    git clone https://github.com/mahiuddin-dev/whatsapp-api-wrapper
    cd whatsapp-api-wrapper
    

Create and Activate a Virtual Environment

  1. Create and activate a virtual environment:
    python -m venv venv
    source venv/bin/activate   # On Windows: venv\Scripts\activate
    

Install Dependencies

  1. Install dependencies:
    pip install -r requirements.txt
    

Configuration

Create a .env File

  1. Create a .env file in the root directory:

    touch .env
    
  2. Add the following environment variables to the .env file:

    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

whatsapp_api_connect-0.0.6.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

whatsapp_api_connect-0.0.6-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file whatsapp_api_connect-0.0.6.tar.gz.

File metadata

  • Download URL: whatsapp_api_connect-0.0.6.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for whatsapp_api_connect-0.0.6.tar.gz
Algorithm Hash digest
SHA256 822546a7645594e41f6bba5c839879abda41d84a03ce824e7265eb0865d41988
MD5 11b2e0b2ac660f238165f9da3071ae14
BLAKE2b-256 59ec95ff7958976d2dee9fbd5049bea475d3f86e68eb3d7ea9edcf4f0bbdb8f2

See more details on using hashes here.

File details

Details for the file whatsapp_api_connect-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for whatsapp_api_connect-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ede23dbe4f38ddac4c9600dee21378b0108e872cb1eaf0f03d4ec03aaf1f8bd2
MD5 87d1733f014c422c305818bbf6933af4
BLAKE2b-256 b14d997618db987c2dadcb19ad80164f4f026305414e3c397f178de2369915da

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