Free SMS API in web application

Hoe Chin picture Hoe Chin · Jul 30, 2009 · Viewed 65.9k times · Source

Does anyone know of any SMS APIs that I can use in my web application to send SMS messages to users?

Answer

David Brown picture David Brown · Jul 30, 2009

Most mobile providers support SNPP (Simple Network Paging Protocol). Despite the name, SNPP is also used to send text messages to cell phones. It's really easy to use. Just determine which mobile provider each user is using and then dispatch a "page" to the corresponding SNPP server.

For example, Sprint's SNPP server is snpp.messaging.sprint.com:444. The basic process goes like this:

  1. Open a connection to the SNPP server.
  2. Send PAGE The phone number
  3. Check for status code 250 in the reply.
  4. Send MESS Your message
  5. Check for status code 250 in the reply.
  6. Send SEND
  7. Again, check for status code 250
  8. Send QUIT

Some servers also support subject lines and delayed messages, along with two-way messaging.