views:

590

answers:

4

I have a web application which i want to enable real time sms notifications to users of the applications. I would like to know how to go about this. Note: i can not use twitter API because i live in west africa, and twitter doesnt send sms to my country Also email2sms is not an option because the movile operators dont allow that in my country. I earnestly await any reply that will show me what to do. Thanks

A: 

I don't have any knowledge in this area. But I think you'll have to talk to the mobile operators, and see if they have any API for sending SMS messages. You'll probably have to pay them, or have some scheme for customers to pay them. Alternatively there might be some 3rd party that implements this functionality.

Douglas Leeder
+3  A: 

What about using a proper sms gateway. These guys got APIs for several languages:

http://www.clickatell.com/developers/php.php

There is an unofficial Python API too

http://www.arnebrodowski.de/projects/clickatell/

L. De Leo
+4  A: 

There are a couple of options.

  • Get some kind of SMS modem or connectivity and use your own cell phone using smslib. I am sorry I don't provide python interfaces but my experience is Java. The downside is that you will pay the full consumer rate. And you will have to put a cell phone on your data center.
  • Connect to SMPP gateway. You will have to talk to the mobile operator in order to make this work. There is a library called jsmpp here. Again, I am sorry it is not python.
  • If it is too much of a hassle you could use an intermediary, which provides HTTP-SMS gateways, like this one. That's easy because you don't need to use SMPP and your system administrators wont bark at you for putting cell phones in the datacenter.
Marcelo Morales
+2  A: 

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:

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)

Dawie Strauss