Development

Multiple SMS to multiple destinations

Send multiple, customised SMS messages to multiple recipients by calling one API method only once.

July 09 2015

Send multiple messages to multiple destinations by calling one API method only once. This allows you to send multiple, customised SMS messages to multiple recipients, or your entire database if necessary.

Some of the uses of this sending method include marketing and promotions, as in our sample code below, but also various notifications and alerts, e.g. in multiplayer gaming, social networks or news updates.

Your request should look like this:

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

{  
   "messages":[  
      {  
         "from":"WineShop",
         "to":"41793026727",
         "text":"Hey Mike, delicious Istrian Malvazija is finally here. Feel free to visit us and try it for free!"
      },
      {  
         "from":"WineShop",
         "to":"41793026834",
         "text":"Hi Jenny, we have new French Merlot on our shelves. Drop by our store for a free degustation!"
      }
   ]
}
 

This way, you'll send specific SMS messages to multiple destinations in a single request. The response will contain information about all the messages sent out:

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

{  
   "bulkId":"f5c4322c-10e7-a41e-5528-34fa0b032134",
   "messages":[  
      {  
         "to":"41793026727",
         "status":{  
            "id":0,
            "groupId":0,
            "groupName":"ACCEPTED",
            "name":"MESSAGE_ACCEPTED",
            "description":"Message accepted"
         },
         "smsCount":1,
         "messageId":"4a54f0242f19-b832-1c39-a7e7a2095f351ed2"
      },
      {  
         "to":"41793026834",
         "status":{  
            "id":0,
            "groupId":0,
            "groupName":"ACCEPTED",
            "name":"MESSAGE_ACCEPTED",
            "description":"Message accepted"
         },
         "smsCount":1,
         "messageId":"9404a69cef19-7a31-ba39-92ace76a5f351ed2"
      }
   ]
}
 

Full reports are standard at Infobip, providing detailed stats that let you gauge the effectiveness of your campaigns and gather customer data.

More about statistics and reports: