API wrapper for Gupshup written in Python
Project description
gupshup-python
gupshup-python is an API wrapper for Gupshup, written in Python.
Installing
pip install gupshup-python
Usage
from gupshup.client import Client
client = Client(apikey='YOUR_API_KEY', app_name='YOUR_APP_NAME')
###Actions for get data These are the actions that the library allows you to perform to send messages by WhatsApp through Gupshup.
- Get Templates app info
client.get_templates_app()
# Returns a json with a list of the templates created for the application in Gupshup..
- Get Variables For Template
client.get_variables_for_template()
# Returns a list with all the variables configured for each of the templates.
- Send Templates Message
data = {
"source": 975846622,
"destination": 12368431,
"template": {
"id": "5f2449fd-e4d6-4d02-9647-e46a1b4635a4",
"params": [
"Test", "New", 123
]
}
}
client.send_templates_msg(data)
# Allows you to send a message through the Gupshup API.
# You must establish the source and destination and additionally the id of the template to use.
# The params will depend on the number of variables you have configured in the template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gupshup_python-0.1.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for gupshup_python-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e512671fc6fe635f233dc329e0cce95421b1c876c60c5fa83b611af99f0457bc |
|
MD5 | b95cb6adc16f65e0037a5f32e53becc8 |
|
BLAKE2b-256 | dac05c106a2cde5dc641afac2f73dd7b1cbe48d2b792aa560f8411b59c232154 |