Python

Python SMS API Wrapper

SMS Enable your product with our Python wrapper.
Follow these steps:

Step 1.
Download “MScience.Sms.py” from https://github.com/MScience/Dragonfly-Python

Step 2.
Import “MScience.Sms” in your python file.

Python example code:

Import MScience.Sms

      f = SmsClient("YourAccountId","YourPassword","","")
      g = f.send([SmsMessage("","+44123456789",0,"Hello World",False),])
for res in g:
      print(res.MessageId())
      (res.PendingMessages())
      (res.MessageBalance())
      (res.SurchargeBalance())
      (res.HasError())
      (res.ErrorMessage())
      stat = f.getMessageStatus([res.MessageId(),])
      for s in stat:
            print(s.Code())
            print(s.SubCode())
Back to top