This project is a Python SDK for the Prompter API. It is intended to be used by developers who want to integrate Lola into their own applications.
pip install lolapy-whatsapp
pip install git+https://...
pip install .
Check the examples folder for more examples
PHONE = getenv("RECIPIENT_PHONE")
connector = WhatsappConnector(
token=getenv("TOKEN"),
phone_number_id=getenv("PHONE_NUMBER_ID")
)
connector.send_text_message("Hello World!", PHONE)
PHONE = getenv("RECIPIENT_PHONE")
connector = WhatsappConnector(
token=getenv("TOKEN"),
phone_number_id=getenv("PHONE_NUMBER_ID")
)
button1 = ReplyButton("id_yes", "Yes")
button2 = ReplyButton("id_no", "No")
connector.send_button_reply("Header Testing",
"Body Testing",
[button1, button2],
PHONE,
footer="Footer Testing")
PHONE = getenv("RECIPIENT_PHONE")
connector = WhatsappConnector(
token=getenv("TOKEN"),
phone_number_id=getenv("PHONE_NUMBER_ID")
)
connector.send_template("lola_verify_account",
PHONE,
body_params=["Alejandro", "*email*"],
button_params=["PAYLOAD"])
response = connector.send_image(
PHONE,
"https://i.imgur.com/Fh7XVYY.jpeg"
)
Create a virtual environment
python3.11 -m venv .venv
Then activate the virtual environment
source .venv/bin/activate
pip install git+https://github.com/alejamp/whatsapp#egg=whatsapp-python