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.5.tar.gz (13.1 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.5-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: whatsapp_api_connect-0.0.5.tar.gz
  • Upload date:
  • Size: 13.1 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.5.tar.gz
Algorithm Hash digest
SHA256 0a43515b5e81491f5ea8caf09fcd5c349ff9542e54c0c2dbe0e0add088cf7609
MD5 ddfeb4e681c32e8506c8b3137a614a5d
BLAKE2b-256 0e3d7f5f4f3684b931cc38fa39c327e5181de6589f43d7dfceb2c50bb71da890

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for whatsapp_api_connect-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8f5b1b0522cd8d256ca6758eb726857120c938f65bf1850895f8e900a0d46c8a
MD5 b98b6722b90b0b7123bfa6fa17bb50be
BLAKE2b-256 6232e63a5492303ee7e1f2e551e6f438c54b4ae63a8a9ba518779c8a5e4c864f

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