How do I enable SMS notifications in my web apps?

前端 未结 7 955
南笙
南笙 2021-01-15 17:55

I have a web application and I would like to enable real time SMS notifications to the users of the applications.

Note: I currently cannot use the Twitter API becau

7条回答
  •  时光取名叫无心
    2021-01-15 18:36

    Another SMS gateway with a Python interface is TextMagic. Their Python API is available from the Google Code project textmagic-sms-api-python. They have libraries available for other languages as well; all wrapping a simple HTTPS API.

    Code samples from the project website:

    How to send an SMS:

    import textmagic.client
    client = textmagic.client.TextMagicClient('your_username', 'your_api_password')
    result = client.send("Hello, World!", "1234567890")
    message_id = result['message_id'].keys()[0]
    

    And retrieve its delivery status:

    response = client.message_status(message_id)
    status = response[message_id]['status']
    

    (Full disclosure: I am the author of the Python wrapper library)

提交回复
热议问题