Send fully-featured binary message

Send advanced binary SMS with all available features and parameters.

Resource

https://api.infobip.com/sms/1/binary/advanced

Parameters

Property name Type Description
bulkId string The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.
from string Represents a sender ID which 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 14 characters.
to* string Message destination address. Addresses must be in international format (Example: 41793026727).
messageId string The ID that uniquely identifies the message sent.
hex string Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: "0f c2 4a bf 34 13 ba ").
dataCoding int (0) Binary content data coding. The default value is (0) for GSM7. Example: (8) for  Unicode data.
esmClass int (0) “Esm_class” parameter. Indicate special message attributes associated with the SMS. Default value is (0).
flash boolean (false) Can be true or false. If the value is set to true, a flash SMS will be sent. Otherwise, a normal SMS will be sent. The default value is false.
intermediateReport boolean The real-time Intermediate delivery report that will be sent on your callback server.
notifyUrl string The URL on your call back server on which the Delivery report will be sent.
notifyContentType string Preferred Delivery report content type. Can be application/json or application/xml.
callbackData string Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters.
validityPeriod int The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).
sendAt datetime Date and time when the message is to be sent. Used for scheduled SMS (SMS not sent immediately, but at the scheduled time).
deliveryTimeWindow object Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of from, to and days properties. Days property is mandatory. From and to properties should be either both included, to allow finer time window granulation or both omitted, to include whole days in the delivery time window.
from object Exact time of day in which the sending can start. Consists of hour and minute properties, both mandatory. Time is expressed in the UTC time zone.
to object Exact time of day in which the sending will end. Consists of an hour and minute properties, both mandatory. Time is expressed in the UTC time zone.
hour int Hour when the time window opens when used in from property or closes when used into the property.
minute int Minute when the time window opens when used in from property or closes when used into the property.
days array_string Days which are included in the delivery time window. Values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. At least one day must be stated.

Request Example

					POST /sms/1/binary/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
Content-Type: application/json
{
	"bulkId":"BULK-ID-123-xyz",
	"messages":[
		{
			"from":"InfoSMS",
			"destinations":[
				{
					"to":"41793026727",
					"messageId":"MESSAGE-ID-123-xyz"
				},
				{
					"to":"41793026731"
				}
			],
			"binary":{
				"hex":"54 65 73 74 20 6d 65 73 73 61 67 65 2e",
				"dataCoding":0,
				"esmClass":0
			},
			"intermediateReport":true,
			"notifyUrl":"https://www.example.com/sms/advanced",
			"notifyContentType":"application/json",
			"callbackData":"DLR callback data",
			"validityPeriod":720
		},
		{
			"from":"41793026700",
			"destinations":[
				{
					"to":"41793026785"
				}
			],
			"binary":{
				"hex":"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E",
				"dataCoding":0,
				"esmClass":0
			},
			"sendAt":"2015-09-29T17:00:00.000+01:00",
			"deliveryTimeWindow": {
				"from": {
					"hour": 6,
					"minute": 0
				},
				"to": {
					"hour": 15,
					"minute": 30
				},
				"days": [
					"MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"
				]
			}
		}
	]
}
					
				
					POST /sms/1/binary/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/xml
<request>
	<bulkId>BULK-ID-123-xyz</bulkId>
	<messages>
    <message>
      <from>InfoSMS</from>
      <destinations>
        <destination>
        	<to>41793026727</to>
        	<messageId>MESSAGE-ID-123-xyz</messageId>
        </destination>
        <destination>
          <to>41793026731</to>
        </destination>
      </destinations>
      <binary>
        <hex>54 65 73 74 20 6d 65 73 73 61 67 65 2e</hex>
        <dataCoding>0</dataCoding>
        <esmClass>0</esmClass>
      </binary>
      <notifyUrl>https://www.example.com/sms/advanced</notifyUrl>
      <notifyContentType>application/json</notifyContentType>
      <callbackData>DLR callback data</callbackData>
      <validityPeriod>720</validityPeriod>
		</message>
		<message>
      <from>41793026700</from>
      <destinations>
        <destination>
        	<to>41793026785</to>
        </destination>
      </destinations>
      <binary>
        <hex>41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E</hex>
        <dataCoding>0</dataCoding>
        <esmClass>0</esmClass>
      </binary>
      <sendAt>2015-09-29T17:00:00.000+01:00</sendAt>
      <deliveryTimeWindow>
        <from>
          <hour>6</hour>
          <minute>0</minute>
        </from>
        <to>
          <hour>15</hour>
          <minute>30</minute>
        </to>
        <days>MONDAY</days>
        <days>TUESDAY</days>
        <days>WEDNESDAY</days>
        <days>THURSDAY</days>
        <days>FRIDAY</days>
        <days>SATURDAY</days>
        <days>SUNDAY</days>
      </deliveryTimeWindow>
		</message>
  </messages>
</request>
					
				
					curl -X POST \
  https://api.infobip.com/sms/1/binary/advanced \
  -H 'accept: application/json' \
  -H 'authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
  -H 'content-type: application/json' \
  -d '{
	"bulkId":"BULK-ID-123-xyz",
	"messages":[
		{
			"from":"InfoSMS",
			"destinations":[
				{
					"to":"41793026727",
					"messageId":"MESSAGE-ID-123-xyz"
				},
				{
					"to":"41793026731"
				}
			],
			"binary":{
				"hex":"54 65 73 74 20 6d 65 73 73 61 67 65 2e",
				"dataCoding":0,
				"esmClass":0
			},
			"intermediateReport":true,
			"notifyUrl":"https://www.example.com/sms/advanced",
			"notifyContentType":"application/json",
			"callbackData":"DLR callback data",
			"validityPeriod":720
		},
		{
			"from":"41793026700",
			"destinations":[
				{
					"to":"41793026785"
				}
			],
			"binary":{
				"hex":"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E",
				"dataCoding":0,
				"esmClass":0
			},
			"sendAt":"2015-09-29T17:00:00.000+01:00",
			"deliveryTimeWindow": {
				"from": {
					"hour": 6,
					"minute": 0
				},
				"to": {
					"hour": 15,
					"minute": 30
				},
				"days": [
					"MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"
				]
			}
		}
	]
}'
					
				
					<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.infobip.com/sms/1/binary/advanced",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\r\n\t\"bulkId\":\"BULK-ID-123-xyz\",\r\n\t\"messages\":[\r\n\t\t{\r\n\t\t\t\"from\":\"InfoSMS\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026727\",\r\n\t\t\t\t\t\"messageId\":\"MESSAGE-ID-123-xyz\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026731\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"intermediateReport\":true,\r\n\t\t\t\"notifyUrl\":\"https://www.example.com/sms/advanced\",\r\n\t\t\t\"notifyContentType\":\"application/json\",\r\n\t\t\t\"callbackData\":\"DLR callback data\",\r\n\t\t\t\"validityPeriod\":720\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"from\":\"41793026700\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026785\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"sendAt\":\"2015-09-29T17:00:00.000+01:00\",\r\n\t\t\t\"deliveryTimeWindow\": {\r\n\t\t\t\t\"from\": {\r\n\t\t\t\t\t\"hour\": 6,\r\n\t\t\t\t\t\"minute\": 0\r\n\t\t\t\t},\r\n\t\t\t\t\"to\": {\r\n\t\t\t\t\t\"hour\": 15,\r\n\t\t\t\t\t\"minute\": 30\r\n\t\t\t\t},\r\n\t\t\t\t\"days\": [\r\n\t\t\t\t\t\"MONDAY\", \"TUESDAY\", \"WEDNESDAY\", \"THURSDAY\", \"FRIDAY\", \"SATURDAY\", \"SUNDAY\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
					
				
					require 'uri'
require 'net/http'

url = URI("https://api.infobip.com/sms/1/binary/advanced")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = "{\r\n\t\"bulkId\":\"BULK-ID-123-xyz\",\r\n\t\"messages\":[\r\n\t\t{\r\n\t\t\t\"from\":\"InfoSMS\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026727\",\r\n\t\t\t\t\t\"messageId\":\"MESSAGE-ID-123-xyz\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026731\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"intermediateReport\":true,\r\n\t\t\t\"notifyUrl\":\"https://www.example.com/sms/advanced\",\r\n\t\t\t\"notifyContentType\":\"application/json\",\r\n\t\t\t\"callbackData\":\"DLR callback data\",\r\n\t\t\t\"validityPeriod\":720\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"from\":\"41793026700\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026785\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"sendAt\":\"2015-09-29T17:00:00.000+01:00\",\r\n\t\t\t\"deliveryTimeWindow\": {\r\n\t\t\t\t\"from\": {\r\n\t\t\t\t\t\"hour\": 6,\r\n\t\t\t\t\t\"minute\": 0\r\n\t\t\t\t},\r\n\t\t\t\t\"to\": {\r\n\t\t\t\t\t\"hour\": 15,\r\n\t\t\t\t\t\"minute\": 30\r\n\t\t\t\t},\r\n\t\t\t\t\"days\": [\r\n\t\t\t\t\t\"MONDAY\", \"TUESDAY\", \"WEDNESDAY\", \"THURSDAY\", \"FRIDAY\", \"SATURDAY\", \"SUNDAY\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}"

response = http.request(request)
puts response.read_body
					
				
					import http.client

conn = http.client.HTTPSConnection("api.infobip.com")

payload = "{\r\n\t\"bulkId\":\"BULK-ID-123-xyz\",\r\n\t\"messages\":[\r\n\t\t{\r\n\t\t\t\"from\":\"InfoSMS\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026727\",\r\n\t\t\t\t\t\"messageId\":\"MESSAGE-ID-123-xyz\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026731\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"intermediateReport\":true,\r\n\t\t\t\"notifyUrl\":\"https://www.example.com/sms/advanced\",\r\n\t\t\t\"notifyContentType\":\"application/json\",\r\n\t\t\t\"callbackData\":\"DLR callback data\",\r\n\t\t\t\"validityPeriod\":720\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"from\":\"41793026700\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026785\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"sendAt\":\"2015-09-29T17:00:00.000+01:00\",\r\n\t\t\t\"deliveryTimeWindow\": {\r\n\t\t\t\t\"from\": {\r\n\t\t\t\t\t\"hour\": 6,\r\n\t\t\t\t\t\"minute\": 0\r\n\t\t\t\t},\r\n\t\t\t\t\"to\": {\r\n\t\t\t\t\t\"hour\": 15,\r\n\t\t\t\t\t\"minute\": 30\r\n\t\t\t\t},\r\n\t\t\t\t\"days\": [\r\n\t\t\t\t\t\"MONDAY\", \"TUESDAY\", \"WEDNESDAY\", \"THURSDAY\", \"FRIDAY\", \"SATURDAY\", \"SUNDAY\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}"

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("POST", "/sms/1/binary/advanced", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
					
				
					HttpResponse<String> response = Unirest.post("https://api.infobip.com/sms/1/binary/advanced")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .body("{\r\n\t\"bulkId\":\"BULK-ID-123-xyz\",\r\n\t\"messages\":[\r\n\t\t{\r\n\t\t\t\"from\":\"InfoSMS\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026727\",\r\n\t\t\t\t\t\"messageId\":\"MESSAGE-ID-123-xyz\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026731\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"intermediateReport\":true,\r\n\t\t\t\"notifyUrl\":\"https://www.example.com/sms/advanced\",\r\n\t\t\t\"notifyContentType\":\"application/json\",\r\n\t\t\t\"callbackData\":\"DLR callback data\",\r\n\t\t\t\"validityPeriod\":720\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"from\":\"41793026700\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026785\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"sendAt\":\"2015-09-29T17:00:00.000+01:00\",\r\n\t\t\t\"deliveryTimeWindow\": {\r\n\t\t\t\t\"from\": {\r\n\t\t\t\t\t\"hour\": 6,\r\n\t\t\t\t\t\"minute\": 0\r\n\t\t\t\t},\r\n\t\t\t\t\"to\": {\r\n\t\t\t\t\t\"hour\": 15,\r\n\t\t\t\t\t\"minute\": 30\r\n\t\t\t\t},\r\n\t\t\t\t\"days\": [\r\n\t\t\t\t\t\"MONDAY\", \"TUESDAY\", \"WEDNESDAY\", \"THURSDAY\", \"FRIDAY\", \"SATURDAY\", \"SUNDAY\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}")
  .asString();
					
				
					var client = new RestClient("https://api.infobip.com/sms/1/binary/advanced");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\r\n\t\"bulkId\":\"BULK-ID-123-xyz\",\r\n\t\"messages\":[\r\n\t\t{\r\n\t\t\t\"from\":\"InfoSMS\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026727\",\r\n\t\t\t\t\t\"messageId\":\"MESSAGE-ID-123-xyz\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026731\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"intermediateReport\":true,\r\n\t\t\t\"notifyUrl\":\"https://www.example.com/sms/advanced\",\r\n\t\t\t\"notifyContentType\":\"application/json\",\r\n\t\t\t\"callbackData\":\"DLR callback data\",\r\n\t\t\t\"validityPeriod\":720\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"from\":\"41793026700\",\r\n\t\t\t\"destinations\":[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"to\":\"41793026785\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t\"binary\":{\r\n\t\t\t\t\"hex\":\"41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E\",\r\n\t\t\t\t\"dataCoding\":0,\r\n\t\t\t\t\"esmClass\":0\r\n\t\t\t},\r\n\t\t\t\"sendAt\":\"2015-09-29T17:00:00.000+01:00\",\r\n\t\t\t\"deliveryTimeWindow\": {\r\n\t\t\t\t\"from\": {\r\n\t\t\t\t\t\"hour\": 6,\r\n\t\t\t\t\t\"minute\": 0\r\n\t\t\t\t},\r\n\t\t\t\t\"to\": {\r\n\t\t\t\t\t\"hour\": 15,\r\n\t\t\t\t\t\"minute\": 30\r\n\t\t\t\t},\r\n\t\t\t\t\"days\": [\r\n\t\t\t\t\t\"MONDAY\", \"TUESDAY\", \"WEDNESDAY\", \"THURSDAY\", \"FRIDAY\", \"SATURDAY\", \"SUNDAY\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
					
				
					var data = JSON.stringify({
  "bulkId": "BULK-ID-123-xyz",
  "messages": [
    {
      "from": "InfoSMS",
      "destinations": [
        {
          "to": "41793026727",
          "messageId": "MESSAGE-ID-123-xyz"
        },
        {
          "to": "41793026731"
        }
      ],
      "binary": {
        "hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e",
        "dataCoding": 0,
        "esmClass": 0
      },
      "intermediateReport": true,
      "notifyUrl": "https://www.example.com/sms/advanced",
      "notifyContentType": "application/json",
      "callbackData": "DLR callback data",
      "validityPeriod": 720
    },
    {
      "from": "41793026700",
      "destinations": [
        {
          "to": "41793026785"
        }
      ],
      "binary": {
        "hex": "41 20 6C 6F 6E 67 20 74 69 6D 65 20 61 67 6F 2C 20 69 6E 20 61 20 67 61 6C 61 78 79 20 66 61 72 2C 20 66 61 72 20 61 77 61 79 2E 2E 2E 20 49 74 20 69 73 20 61 20 70 65 72 69 6F 64 20 6F 66 20 63 69 76 69 6C 20 77 61 72 2E 20 52 65 62 65 6C 20 73 70 61 63 65 73 68 69 70 73 2C 20 73 74 72 69 6B 69 6E 67 20 66 72 6F 6D 20 61 20 68 69 64 64 65 6E 20 62 61 73 65 2C 20 68 61 76 65 20 77 6F 6E 20 74 68 65 69 72 20 66 69 72 73 74 20 76 69 63 74 6F 72 79 20 61 67 61 69 6E 73 74 20 74 68 65 20 65 76 69 6C 20 47 61 6C 61 63 74 69 63 20 45 6D 70 69 72 65 2E",
        "dataCoding": 0,
        "esmClass": 0
      },
      "sendAt": "2015-09-29T17:00:00.000+01:00",
      "deliveryTimeWindow": {
        "from": {
          "hour": 6,
          "minute": 0
        },
        "to": {
          "hour": 15,
          "minute": 30
        },
        "days": [
          "MONDAY",
          "TUESDAY",
          "WEDNESDAY",
          "THURSDAY",
          "FRIDAY",
          "SATURDAY",
          "SUNDAY"
        ]
      }
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.infobip.com/sms/1/binary/advanced");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
					
				

Response

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

{
    "bulkId": "BULK-ID-123-xyz",
    "messages": [
        {
            "to": "41793026727",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 7,
                "name": "PENDING_ENROUTE",
                "description": "Message sent to next instance"
            },
            "smsCount": 1,
            "messageId": "MESSAGE-ID-123-xyz"
        },
        {
            "to": "41793026731",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 7,
                "name": "PENDING_ENROUTE",
                "description": "Message sent to next instance"
            },
            "smsCount": 1,
            "messageId": "2033920598431630183"
        },
        {
            "to": "41793026785",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Pending Accepted"
            },
            "messageId": "2033920598431630184"
        }
    ]
}
					
				
					HTTP/1.1 200 OK
Content-Type: application/xml

&lt;?xml version='1.0' encoding='UTF-8'?&gt;
<smsResponse>
    <bulkId>BULK-ID-123-xyz</bulkId>
    <messages>
        <message>
            <to>41793026731</to>
            <status>
                <groupId>1</groupId>
                <groupName>PENDING</groupName>
                <id>7</id>
                <name>PENDING_ENROUTE</name>
                <description>Message sent to next instance</description>
            </status>
            <smsCount>1</smsCount>
            <messageId>2033919425471631661</messageId>
        </message>
        <message>
            <to>41793026727</to>
            <status>
                <groupId>1</groupId>
                <groupName>PENDING</groupName>
                <id>7</id>
                <name>PENDING_ENROUTE</name>
                <description>Message sent to next instance</description>
            </status>
            <smsCount>1</smsCount>
            <messageId>MESSAGE-ID-123-xyz</messageId>
        </message>
        <message>
            <to>41793026785</to>
            <status>
                <groupId>1</groupId>
                <groupName>PENDING</groupName>
                <id>26</id>
                <name>PENDING_ACCEPTED</name>
                <description>Pending Accepted</description>
            </status>
            <messageId>2033919425471631662</messageId>
        </message>
    </messages>
</smsResponse>
					
				

Fully featured binary message tutorials:

Response format

If successful, the response header HTTP status code will be 200 OK and the message will be sent.

If you try to send the message without authorization, you will receive a 401 Unauthorized error .

SMSResponse

Parameter Type Description
bulkId String The ID that uniquely identifies the request. Bulk ID will be received only when a message is sent to more than one destination address.
messages SMSResponseDetails Array of sent message objects, one object per every message.

SMSResponseDetails

Parameter Type Description
to String The message destination address.
status Status Indicates whether the message is sent successfully, not sent, delivered, not delivered, waiting for delivery or any other possible status.
smsCount int The number of sent message segments. This value is not returned for scheduled messages.
messageId String The ID that uniquely identifies the sent message.

Status

Parameter Type Description
groupId int Status group ID.
groupName String Status group name.
id int Status ID.
name String Status name.
description String Human-readable description of the status.
action String Action that should be taken to eliminate the error.