For your use we have also included a Python class for our API.
Download Python API Class and Examples
An example of how to use this API can be seen below.
import PanaceaApi
""" You can use the panacea include without having pycurl installed,
however, you will be unable to create batches.
We recommend you go on to: http://pycurl.sourceforge.net/ and
get the latest version of pycurl installed
"""
#checking if pycurl is installed
#if its not, we are going to use urllib and urllib2
useCurl = True
panacea = PanaceaApi.PanaceaApi(useCurl)
#set our username and password
panacea.setUsername('demouser')
panacea.setPassword('demouser')
#some optional settings
#panacea.setPerformActionsImmediately(value) -> value can be true or false
#set above setting to false if you want to queue actions
#panacea.debugSetting = True -> Set debugging mode to true
#SOME EXAMPLES:
#get your balance
my_balance = panacea.user_get_balance()
print "My balance is currently: " + str(my_balance[1]["details"])
#send a message
result = panacea.send_message('27111234567','Hello World!','27111325533')
if panacea.OK(result[1]):
#check the last message status
message_status = panacea.message_status(str(result[1]["details"]))
for x,y in message_status[1].iteritems():
print x, y
else:
print panacea.error
This class is based on the HTTP API.