New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

whatsapp-messager

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whatsapp-messager

WhatsApp message sender using WhatsApp Business API

  • 0.0.4
  • PyPI
  • Socket score

Maintainers
1

whatsapp-messager is a Python library that makes it easy to send messages using WhatsApp's official API. This library is built to interact with the WhatsApp Business API, providing a simple way to send text messages and OTP messages.

Features

  • Send OTP messages via WhatsApp.

  • Send general text messages via WhatsApp.

Installation

You can install the library using pip:

pip install whatsapp-sender

Usage

To start using whatsapp-sender, you need to create an instance of the WhatsAppSender class with your access token, phone number ID, and version number.

Import and Setup

from whatsapp_messager.messaging import WhatsAppSender

# Initialize the WhatsAppSender
sender = WhatsAppSender(
    access_token="your_access_token",
    phone_number_id="your_phone_number_id",
    version_number="v15.0"  # Optional, default is v15.0
)

Send OTP Message

To send an OTP message:

response = sender.send_otp_message(recipient_phone_number="1234567890", otp="123456")
print(response)

Send Text Message

To send a text message:

response = sender.send_text_message(
    recipient_phone_number="1234567890",
    message="Hello from WhatsApp Sender!",
    country_code="+1"  # Include the appropriate country code
)
print(response)

Requirements

  • Python 3.7+

  • requests library

Error Handling

The library provides basic error handling and returns success or failure messages based on the API response. If an error occurs, the response will contain details about the failure.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

  • John Gbaya-kokoya

  • gbayakokoyajohnjr@gmail.com

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue to improve the library.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc