Sending Bulk API Requests

Messaging API supports batch request. It is useful when you want to send different messages to multiple destinations in a single API request. Batch API request reduces the number of HTTP connections you have to make. Using batch message API request, you can send messages up to 1000 destinations. For each destination a delivery receipt is generated. The batch message API accepts an array of messaging object with different message and destination. The response will have a separate transaction ID for each destination.

For example, a bank can send a personalised greeting message to its customers (maximum limit 1000) using the delivery channel as SMS in a single API request.

📘

If your IMIconnect web access URL is on a .io TLD, then you should use the API end point with .io. For example, if your domain is mycompany.imiconnect.com, then your API base URL will be api.imiconnect.com. But if your domain is mycompany.imiconnect.io, then your API base URL will be api.imiconnect.io.

Request format of batch API:

[{
        "deliverychannel": "sms",
        "channels": {
            "sms": {
                "text": "Hi John, Greetings from MNOP bank. "
            }
        },
        "destination": [{
            "msisdn": ["91900000009"]
        }]
    }, {
        "deliverychannel": "sms",
        "channels": {
            "sms": {
                "text": "Hi Mark, Greetings from MNOP bank. "
            }
        },
        "destination": [{
            "msisdn": ["91900000008"]
        }]
    }, {
        "deliverychannel": "sms",
        "channels": {
            "sms": {
                "text": "Hi steve, Greetings from MNOP bank. "
            }
        },
        "destination": [{
            "msisdn": ["91900000007"]
        }]
    }

]
[  
   {  
   "correlationid":"<Unique transaction ID from the client end>",
   "notifyurl":"<Notifications will be sent to the URL specified here>",
   "callbackData":"<Identifier sent alongside notifications to the notifyurl>",
   "expiry":"<Expiry time in UTC format, after which messages will not be pushed.>",
   "priority":"<Accepts numbers 1-low, 2-medium, and 3-high>",
   "deliverychannel":"sms",
   "message":{  
      "template":"<Message template ID.>",
         "parameters":{  
            "parameter1":"<value>",
            "parameter2":"<value>",
            "parameter3":"<value>"
         }
      },
      "channels":{  
         "sms":{  
            "type":"<Message type 1– Text, 2- Flash, 3– Binary, 4– Unicode>",
            "text":"<Channel specific message text>",
            "body":"<Hexadecimal content for binary type message>",
            "media-path":"<Media path which will be appended to SMS text>",
            "senderid":"<Predefined Sender ID for this message>"
         }
      },
      "destination":[  
         {  
            "msisdn/customerid":[  
               "<value1>",
               "<value2>"
            ],
            "correlationid":"<A unique transaction ID up to 50 bytes used by Client to match requests with responses. Will override correlationid given in request body.>"         
         }
      ]
   },
{  
   "correlationid":"<Unique transaction ID from the client end>",
   "notifyurl":"<Notifications will be sent to the URL specified here>",
   "callbackData":"<Identifier sent alongside notifications to the notifyurl>",
   "expiry":"<Expiry time in UTC format, after which messages will not be pushed.>",
   "priority":"<Accepts numbers 1-low, 2-medium, and 3-high>",
   "deliverychannel":"sms",
   "message":{  
      "template":"<Message template ID.>",
      "parameters":{  
         "parameter1":"<value>",
         "parameter2":"<value>",
         "parameter3":"<value>"
      }
   },
   "channels":{  
      "sms":{  
         "type":"<Message type 1– Text, 2- Flash, 3– Binary, 4– Unicode>",
         "text":"<Channel specific message text>",
         "body":"<Hexadecimal content for binary type message>",
         "media-path":"<Media path which will be appended to SMS text>",
         "senderid":"<Predefined Sender ID for this message>"
      }
   },
   "destination":[  
      {  
         "msisdn/customerid":[  
            "<value1>",
            "<value2>"
         ],
         "correlationid":"<A unique transaction ID up to 50 bytes used by Client to match requests with responses. Will override correlationid given in request body.>"
      }
  ]
}
]

Response

{
  "response": [
    {
      "description": "Queued",
      "correlationid": "",
      "code": "1001",
      "transid": "29e6cff5-5f0d-4872-b336-57799cb63da7"
    },
    {
      "description": "Queued",
      "correlationid": "",
      "code": "1001",
      "transid": "29e6cff5-5f0d-4872-b336-57799cb63da7_1"
    },
    {
      "description": "Queued",
      "correlationid": "",
      "code": "1001",
      "transid": "29e6cff5-5f0d-4872-b336-57799cb63da7_2"
    }
  ]
}

Copyright © 2000 - 2021 IMImobile Limited | All Rights Reserved