SMS to multiple destinations

Send single textual message to multiple destinations

You have opened a wine shop, and performed all the necessary preparations for the grand opening. One of the most important things you’ll need to do is to invite your future customers. Do it over SMS - one of the most powerful promotional channels.

We will help you do it!

In order to send the same message to multiple phone numbers, you need to perform an HTTP POST request to https://api.infobip.com/sms/2/text/single.

The example request will contain only two phone numbers for easier understanding:

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

{  
   "from":"WineShop",
   "to":[  
      "41793026727",
      "41793026834"
   ],
   "text":"Wine shop grand opening at Monday 8pm. Don't forget glasses."
}	
  

Header section of the request should contain authorization and content type:

  • Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
  • Content-Type: application/json

Looking at the request body, there are three parameters:

  • from parameter represents the sender of the SMS message - it can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (Example: CompanyName). Numeric sender ID length should be between 3 and 16 characters.
  • to parameter is an array of message destination addresses. Destination addresses must be in international format (Example: 41793026727).
  • text text of the message that will be sent.

This will send an SMS to two addresses with the same content and sender.

The response you will get will look like this:

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

{
    "bulkId": "2034070510160109025",
    "messages": [
        {
            "to": "41793026727",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Message sent to next instance"
            },
            "messageId": "2034070510160109026"
        },
        {
            "to": "41793026834",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Message sent to next instance"
            },
            "messageId": "2034070510250109027"
        }
    ]
}	
  

In the response, you’ll receive a bulkId and an array of messages:

  • bulkId is used for getting delivery reports for SMS messages sent to multiple destinations.
  • Array of messages consists of Send SMS response details:
    • to parameter as a message recipient
    • status object for message status
    • smsCount represents the number of SMS messages sent to one destination
    • messageId uniquely identifies the message sent

After you have sent out invitation messages, it’s time to promote a different product to different customers. With a single API method multiple messages can be sent to a multiple destinations.