Products

Step-by-step Tutorial For building Social Invites Over SMS API

Welcome to our step-by-step guide through the implementation of Infobip Social Invites API.

May 19 2016

How do you react when you get a sponsored SMS message inviting you to play a game or check out an app? Most likely, you ignore it. Let’s try a different question. How do you react when your friend tells you that a game is really great and you have to try it? You’ll most likely play it.

84% of global consumers believe referrals are the most trustworthy source of information about products (Nielsen). There's no one better to spread a word about your new app, game or website than users themselves. Social Invites fuel organic user growth by incentivizing users to act as brand ambassadors and engage their friends.

Sending SMS invites is also free for the users, and you can include information about the contact sending it, which guarantees it will be read more carefully.

In this tutorial we'll get you more acquainted on how to implement Infobip API into your app and what advantages that brings.

Social Invites in 5 steps:

  1. Send SMS over API to get more users for your app
  2. Infobip takes care of global coverage and provides best-in-class delivery
  3. User receives SMS containing a direct download link for your app*
  4. User opens the SMS and clicks the link - You get a new client
  5. Analyse statistics to detect conversion rate patterns

*If a user already uses your app, the link can redirect them to the app, increasing usage

Furthermore, Infobip offers you the possibility to understand how many people are recommending your app to their friends and how many of those friends viewed your app on the app store. Immediately, you can also activate conversion rate statistics for social invites sent to users.

Integrating social invites into your app is as easy. Now, we’re going to show you how to do it in three easy steps.

Step 1. Send Social Invites

The Social Invites functionality is a built-in feature of the Fully featured textual message API method. All you need to do is include the tracking object into your request.

Note
When defining the tracking object for Social Invites, set the parameter 'track' to URL. For parameter 'type' choose your own identifier. For example: IOS_APP, or SOCIAL_INVITES

By enabling tracking you are both enabling automatic shortening of your long links and also tracking users’ click-through rates. Here is an example how to send social invites for your new Android application using Infobip's API :

JSON
POST /sms/1/text/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{
   "bulkId":"BULK-ID-123-xyz",
   "messages":[
      {
         "from":"InfoSMS",
         "destinations":[
            {
               "to":"41793026727",
               "messageId":"MESSAGE-ID-123-xyz"
            },
            {
               "to":"41793026731"
            }
         ],
         "text":"Hey, take a look at this awesome application :  https://play.google.com/store/apps/details?id=com.myApp"
      }
    ],
   "tracking":{
         "track":"URL",
         "type":"SOCIAL_INVITES"
    }
}

The user will receive the original SMS message with the shortened URL:

Hey, take a look at this awesome application: http://eel.nu/EJsE/cf9ZH

So, the only remaining things are: open the SMS message and click the shortened link - and you have a new user on your application!

In the following chapter we'll show you how to retrieve the conversion rate statistics for your new and awesome application.

Step 2. Social Invites Statistics

In order for you to focus on your new app Infobip will take care of the delivery of messages and will handle the conversion rate process statistics.

Social Invites conversion rate process
 
Send SMS - start process
User clicks link - end of process
 
Fully automated feature - no need for additional API calls or additional parameters

As soon as you send a message with the included tracking object the conversion rate process starts. Once the user clicks the link included in the SMS the end of process is triggered. It is all done automatically, with no need to configure additional parameters or call different APIs, all the messages and URL link clicks will be included in the statistics.

GET api.infobip.com/ct/1/process

The conversion rate processes are identified by a 'key'. There are several methods which can be used to obtain the statistics of conversion rate processes. However, the first step is to get all conversion rate processes linked to your account.

JSON request

JSON
GET: /ct/1/processes
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

JSON response - contains all processes on a single account

JSON
HTTP/1.1 200 OK
Content-Type: application/json

{
"processes": [1]
  {
        "key": "34BC1CA2CA7DF423459556AD7FC5A1A2"
        "name": "AUTO_GENERATED_PROCESS"
        "timeAdded": "2015-03-29T11:01:49.373+0000"
        "type": "SOCIAL_INVITES"
        "description": "Auto generated tracking process."
  }
}

GET api.infobip.com/ct/1/process/:key/conversionrate

Using the key from the previous statement retrieve conversion rate statistics for a single process.

JSON Request

JSON
GET: /ct/1/process/34BC1CA2CA7DF423459556AD7FC5A1A2/conversionrate
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

JSON Response - conversion tracking statistics

JSON
HTTP/1.1 200 OK
Content-Type: application/json

{
  "statistics": [
    {
      "intervalStart": "2015-02-12T09:58:20.337+0100",
      "startCount": 200,
      "endCount": 170,
      "conversionRate": 0.85
    }
  ], 
  "cumulativeStatistics": {
    "startCount": 200,
    "endCount": 170,
    "conversionRate": 0.85
  }
}

The Response contains basic statistical data of a single conversion rate process :

Parameter Type Description
startCount long Number of sent SMS messages
endCount long Number of opened links from SMS messages
conversionRate double Conversion rate for your application.

The following statistics represent the basic set of data which is collected and that could be retrieved using API.

Additionally, we collect detailed CTR (click-through rates) with other useful information:

  • User’s mobile phone number
  • Network prefix
  • Country prefix
  • Mobile phone operating system

Refer-a-Friend fuels organic user growth by incentivizing users to act as brand ambassadors and engage their friends in just two easy steps.

Start using it today!