Custom Bulk ID and Message ID

Setup a custom bulk ID and message ID to identify your SMS messages more easily.

In order to uniquely identify your messages or an entire job, you can use bulkId and messageId:

  • Bulk ID uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.
  • Message id uniquely identifies the message sent.

Both the bulk ID and message ID can either be generated by the Infobip system and they can be user defined. If you want to set custom bulk and message IDs, you should use our Fully-featured textual message API method.

Here is an example of how you can set custom bulk and message IDs in your request:

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

{
   "bulkId":"CUSTOM-BULK-ID-1",
   "messages":[
      {
         "from":"InfoSMS",
         "destinations":[
            {
               "to":"41793026727",
               "messageId":"CUSTOM-MESSAGE-ID-1"
            },
            {
               "to":"41793026731",
			  			 "messageId":"CUSTOM-MESSAGE-ID-2"
            }
         ],
         "text":"A long time ago, in a galaxy far, far away..."
      },
      {
         "from":"41793026700",
         "destinations":[
            {
               "to":"41793026785"
            }
         ],
         "text":"It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
      }
   ]
}	
  

In this example, multiple messages are sent to multiple destinations in a single request:

  • Custom bulkId is set for the entire request: CUSTOM-BULK-ID-1
  • Two identical messages are sent to multiple destinations with custom messageIds: CUSTOM-MESSAGE-ID-1 and CUSTOM-MESSAGE-ID-2.
  • The third message is sent to a single destination without a custom messageId so the message ID will be generated by the Infobip system.

The response you will get will look like this:

{
  "bulkId": "CUSTOM-BULK-ID-1",
  "messages": [
    {
      "to": "41793026727",
      "status": {
        "groupId": 1,
        "groupName": "PENDING",
        "id": 7,
        "name": "PENDING_ENROUTE",
        "description": "Message sent to next instance"
      },
      "smsCount": 1,
      "messageId": "CUSTOM-MESSAGE-ID-1"
    },
    {
      "to": "41793026731",
      "status": {
        "groupId": 1,
        "groupName": "PENDING",
        "id": 7,
        "name": "PENDING_ENROUTE",
        "description": "Message sent to next instance"
      },
      "smsCount": 1,
      "messageId": "CUSTOM-MESSAGE-ID-2"
    },
    {
      "to": "41793026785",
      "status": {
        "groupId": 1,
        "groupName": "PENDING",
        "id": 7,
        "name": "PENDING_ENROUTE",
        "description": "Message sent to next instance"
      },
      "smsCount": 1,
      "messageId": "06df139a-7eb5-4a6e-902e-40e892210455"
    }
  ]
}	
  

As you can see, three messages are sent. Two of them with a custom message ID and one with a system defined ID. The entire request is identified by the custom bulk ID.