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

Uploaded Python 3

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

Hashes for whatsapp_api_connect-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b01e488ece5d4007717b15ea654159182356defbe40ed0c00caf46a9b6118a11
MD5 83a980065fe028884e358738630c3c07
BLAKE2b-256 7b013fa0f77d225c9d01d0a8e8ed8e27d12418768fde863bbbdacb59d8aa33e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for whatsapp_api_connect-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 95ccf3ed2a4a0a58f0dc56627780d59a792b511df1d9c8b239c05bb1f8854a8a
MD5 4930d3a8ccf2f353417ad9b677165fb5
BLAKE2b-256 6deef6cf9df5c3fc6b868e95d0113676ad4ca446969d4d6b1e4dccdc83705875

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