The SDK provides convenient access to the Shopyangu Communications APIs to python apps.
Take a look at the API docs here.
$ pip install git+https://github.com/Shopyangu-engineering/shopyangu_comms-python.git#egg=shopyangu_comms
- Python 2.7 >
The package needs to be configured with your API key, which you can get from the dashboard.
# import package
import shopyangu_comms
# Initialize SDK
api_key = "YOUR_API_KEY"
shopyangu_comms.initialize(api_key)
# Initialize a service e.g. SMS
sms = shopyangu_comms.SMS
# Use the service synchronously
response = sms.send("Hello Message!", "+2547xxxxxx")
print(response)See example for more usage examples.
Initialize the SDK by calling shopyangu_comms.initialize(api_key). After initialization, you can get instances of offered services as follows:
- SMS:
shopyangu_comms.SMS
-
send(message: str, recipient: str, sender_id: str = None): Send a message.message: SMS content.REQUIREDrecipient: The phone number receiving the message.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Shopyangu account.
If you find a bug, please file an issue on our issue tracker on GitHub.