We encounter SMS application on a daily basis. Voting on reality shows, opinion polls on newspaper or your daily horoscope on SMS – everything is an SMS Application (or as we lazy developers call it – SMS App). Just until few months back, it was very difficult for a novice programmer to write an SMS app. It was only expert’s cup of tea. But then SMSGupShup launched an application programming interface (API) using which anyone with little knowledge of programming can write an SMS App.
In order to write an application, first thing we need to know is how these apps work. Any app will have two clear parameters associated to it. First is shortcode (The number which is used to communicate with the app) and second Keyword (The first word of any SMS Response). Let’s understand this using an example. Consider an App designed to calculate love compatibility score between two persons. If you visit the actual app page here, you will see the line “SMS to 56767888: Love <name1> <name2> “. It indicates that if you want to calculate love score between JOHN and BIPASA then you need to send LOVE JOHN BIPASA to 5676788. In this example, shortcode is 56767888 and keyword is LOVE.
So, why shortcode and keywords are important? Well, shortcode are just like mobile numbers. So, the app will recieve only messages sent to a particular shortcode for the obvious reason and on a single shortcode there are various apps running, so the keyword determines which message should go to which app. SMSGupShup provides you a shortcode and keywords for any app you want to write. (Keywords. Because complex apps can have more than one keyword). To apply for API access go here. Did I mention it is FREE?
On the registration form you will see one unfamiliar Input field namely ‘App URL’. So, what is this AppURL? To understand appURL, you need to know how this API works internally. Let’s continue with our example of Love application. What happens (internally) if someone sends LOVE JOHN BIPASA to 56767888? (Assume that mobile number of the person is 9876543210.
- Since the shortcode 56767888 is owned by SMSGupShup, the message goes to them.
- Now SMSGupShup takes the message and reads the keyword, which is LOVE in this case.
- Since everyone registered their own keywords with SMSGupShup, they send this whole message (LOVE JOHN BIPASA) and the incoming number (9876543210) to LOVE Application.
- Love Application takes the number and the SMS. Process it. and calculated the love score using some algorithm (Say 80%). And send back a response to SMSGupShup containing what SMS to send (Your Love score is 80%) and Whom (9876543210). Responses are sent in XML or JSON format, which we will discuss later
- SMSGupShup takes the response and sends the SMS to given number.
Read and understand the process completely.
Important step to note here is STEP 3. What does it mean that they send the message to love application? Well, Application is nothing but a file (written in PHP, Java or even C) somewhere on the web. SMSGupShup needs to know where to send the messages for your particular App. AppURL is URL of this particular file. (Which you can host anywhere on web)
So, if you are planning to put your application file (which will process the incoming SMS and gives back response to user) at http://example.com/app.php then this URL will be your AppURL. Now let’s assume that we want to develop an application QUOTE, which will send back a nice quote to the user.
AppName: Quotation
Keyword: QUOTE
AppURL: http://webkoof.com/quote.php (This is the file we have to write.)
Break Time. We will write our application (quote.php) in next session.








