{"_id":"5518fe6845b0d80d001521f3","__v":3,"parentDoc":null,"user":"54eb4fdedf7add210007b29b","category":{"_id":"55153a6de68daa2f00cff838","__v":12,"pages":["55154703c859ac2f0001b481","55155f2abc466623002afe88","55156601fd26132300e74e40","551594f3b2473817004172d6","5518fe6845b0d80d001521f3","55190583822f9c23006e9532","55191994337285170047f83e","55252726d919032b0057ac91","55376acc8021c00d00f54606","554a1276c5138431005d94a3","554a13b9c5138431005d94a6","565490a05ffae70d0078e4bb"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-03-27T11:09:33.815Z","from_sync":false,"order":2,"slug":"send-sms","title":"Send SMS"},"editedParams2":true,"editedParams":true,"project":"54eb50e5615ffc1900305a16","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":27,"createdAt":"2015-02-23T17:30:32.501Z","releaseDate":"2015-02-23T17:30:32.501Z","categories":["54eb63b959b1172100334faf","54eb63b959b1172100334fb0","54eb63b959b1172100334fb1","54eb63b959b1172100334fb2","54ed8dd4ab373e2300f50eae","54ed99b2ab373e2300f50ede","55153a6de68daa2f00cff838","551546edbc466623002afe72","5515472ac28d6125001b8884","55154749c28d6125001b8885","555d9b4106dfec0d00d38ea7","5613e06e433e5735007c7708","5624bbb785a31117001c5403","56669e857cc81e0d00253f8e","568b8d837a42220d00498311","56a632277ef6620d00e2f18a","56d8147c3eb4dd0b00201aac","57a9ce2fac6db30e000d7efd","57a9cf4e944ea60e00dc3f74","58172386715dce0f00da4aa0","582dc59ee1b8692300c0dd03","589b19b4fec2730f0082e040","58b04a023529383900a759b5","58b92d1598157a0f004869bf","592e7685c58275000f20174f","59392839e376d4002f8a0474","59393064e376d4002f8a05a1","5947ae0d4005e2000f3a4fec","594a74df1d1de5001ab3517a","5954bc387a147f001b918915"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":["5881d3661eb3be1b006d63b7"],"next":{"pages":[],"description":""},"createdAt":"2015-03-30T07:42:32.890Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"{  \n   \"bulkId\":\"1036A4cb-803a-4a73-a5a6-7e4fc3791722\",\n   \"messages\":[  \n      {  \n         \"to\":\"41793026727\",\n         \"status\":{  \n            \"groupId\":7,\n            \"groupName\":\"PENDING\",\n            \"id\":7,\n            \"name\":\"PENDING_ENROUTE\",\n            \"description\":\"Message sent to next instance\"\n         },\n         \"smsCount\":1,\n         \"messageId\":\"1254df3e-ab62-15af5-230b-14d8e65c7540\"\n      },\n      {  \n         \"to\":\"41793026785\",\n         \"status\":{  \n            \"groupId\":1,\n            \"groupName\":\"PENDING\",\n            \"id\":7,\n            \"name\":\"PENDING_ENROUTE\",\n            \"description\":\"Message sent to next instance\"\n         },\n         \"smsCount\":1,\n         \"messageId\":\"1877df3e-4b62-46f5-819b-14d8e65c2291\"\n      }\n   ]\n}","language":"json","status":200}]},"settings":"554860d6d2c8410d006c215e","examples":{"codes":[{"name":"","language":"json","code":"POST /sms/1/binary/multi HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\t\n{  \n   \"messages\":[  \n      {  \n         \"from\":\"InfoSMS\",\n         \"to\":[  \n            \"41793026727\",\n            \"41793026731\"\n         ],\n         \"binary\":{  \n            \"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\n            \"dataCoding\":0,\n            \"esmClass\":0\n         }\n      },\n      {  \n         \"from\":\"41793026700\",\n         \"to\":\"41793026785\",\n         \"binary\":{  \n            \"hex\":\"6d 4b 8B d5 77 ed 4f e1 30 02\",\n            \"dataCoding\":8,\n            \"esmClass\":0\n         }\n      }\n   ]\n}"}]},"method":"post","auth":"required","params":[{"_id":"5518fe6845b0d80d001521f4","ref":"","in":"body","required":false,"desc":"Represents sender ID and 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 14 characters.","default":"","type":"string","name":"from"},{"_id":"5518ffb44ced683700ad765d","ref":"","in":"body","required":true,"desc":"Array of message destination addresses. If you want to send a [message to one destination](http://dev.infobip.com/v1/docs/send-single-binary-sms#section-single-binary-message-to-one-destination), a single String is supported instead of an Array. Destination addresses must be in international format (Example: `41793026727`).","default":"","type":"array_string","name":"to"},{"_id":"5518ffb44ced683700ad765c","ref":"","in":"body","required":false,"desc":"Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by space character (Example: `\"0f c2 4a bf 34 13 ba\"`).","default":"","type":"string","name":"hex"},{"_id":"5518ffb44ced683700ad765b","ref":"","in":"body","required":false,"desc":"Binary content data coding. Default value is (`0`) for GSM7. Example: (`8`) for Unicode data.","default":"","type":"int","name":"dataCoding"},{"_id":"5518ffb44ced683700ad765a","ref":"","in":"body","required":false,"desc":"“Esm_class” parameter. Indicate a special message attributes associated with the SMS. Default value is `(0)`.","default":"","type":"int","name":"esmClass"}],"url":"/sms/:version/binary/multi"},"isReference":true,"order":3,"body":"# Response format\n\nIf successful, response header HTTP status code will be `200 OK` and the messages will be sent.\n\nIf you try to send messages without authorization, you will receive an error `401 Unauthorized`.\n\n## SMSResponse\n\n|Parameter|Type|Description|\n|-|-|-|\n|*bulkId*|String|The ID that uniquely identifies the request. Bulk ID will be received only when you send the message to [more than one destination address](#section-multiple-binary-messages-to-multiple-destinations).|\n|*messages*|[SMSResponseDetails](#section-sendsmsresponsedetails)[]|Array of sent message objects, one object per every message.|\n\n### SMSResponseDetails\n\n|Parameter|Type|Description|\n|-|-|-|\n|*to*|String|The message destination address.|\n|*status*|[Status](#section-status)|Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.|\n|*smsCount*|int|The number of sent message segments.|\n|*messageId*|String|The ID that uniquely identifies the message sent.|\n\n#### Status\n\n|Parameter|Type|Description|\n|-|-|-|\n|*groupId*|int|Status [group ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*groupName*|String|Status [group name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*id*|int|Status [ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*name*|String|Status [name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*description*|String|Human readable [description](http://dev.infobip.com/v1/docs/response-codes#status-object-example) of the status.|\n|*action*|String|[Action](http://dev.infobip.com/v1/docs/response-codes#status-object-example) that should be taken to eliminate the error.|\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Find out more about Data coding and Esm_class usage [here](http://www.3gpp.org/DynaReport/23038.htm).\",\n  \"title\": \"Note:\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional examples\"\n}\n[/block]\n# Multiple binary messages to multiple destinations\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /sms/1/binary/multi HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\\nContent-Type: application/json\\n\\n{\\n\\t\\\"messages\\\":[\\n\\t\\t{\\n\\t\\t\\t\\\"from\\\":\\\"InfoSMS\\\",\\n\\t\\t\\t\\\"to\\\":[\\n\\t\\t\\t\\t\\\"41793026727\\\",\\n\\t\\t\\t\\t\\\"41793026731\\\"\\n\\t\\t\\t],\\n\\t\\t\\t\\\"binary\\\":{\\n\\t\\t\\t\\t\\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\",\\n\\t\\t\\t\\t\\\"dataCoding\\\":0,\\n\\t\\t\\t\\t\\\"esmClass\\\":0\\n\\t\\t\\t}\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"from\\\":\\\"41793026700\\\",\\n\\t\\t\\t\\\"to\\\":\\\"41793026785\\\",\\n\\t\\t\\t\\\"binary\\\":{\\n\\t\\t\\t\\t\\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\",\\n\\t\\t\\t\\t\\\"dataCoding\\\":8,\\n\\t\\t\\t\\t\\\"esmClass\\\":0\\n\\t\\t\\t}\\n\\t\\t}\\n\\t]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"POST /sms/1/binary/multi HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\\nAccept: application/xml\\n\\n<request>\\n   <messages>\\n      <message>\\n         <from>InfoSMS</from>\\n         <to>\\n            <to>41793026727</to>\\n            <to>41793026731</to>\\n         </to>\\n         <binary>\\n            <hex>54 65 73 74 20 6d 65 73 73 61 67 65 2e</hex>\\n            <dataCoding>0</dataCoding>\\n            <esmClass>0</esmClass>\\n         </binary>\\n      </message>\\n      <message>\\n         <from>41793026700</from>\\n         <to>\\n            <to>41793026785</to>\\n         </to>\\n         <binary>\\n            <hex>6d 4b 8B d5 77 ed 4f e1 30 02</hex>\\n            <dataCoding>8</dataCoding>\\n            <esmClass>0</esmClass>\\n         </binary>\\n      </message>\\n   </messages>\\n</request>\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X POST \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\\\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\\\\n-d '{  \\n   \\\"messages\\\":[  \\n      {  \\n         \\\"from\\\":\\\"InfoSMS\\\",\\n         \\\"to\\\":[  \\n            \\\"41793026727\\\",\\n            \\\"41793026731\\\"\\n         ],\\n         \\\"binary\\\":{  \\n            \\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\",\\n            \\\"dataCoding\\\":0,\\n            \\\"esmClass\\\":0\\n         }\\n      },\\n      {  \\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"to\\\":\\\"41793026785\\\",\\n         \\\"binary\\\":{  \\n            \\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\",\\n            \\\"dataCoding\\\":8,\\n            \\\"esmClass\\\":0\\n         }\\n      }\\n   ]\\n}' https://api.infobip.com/sms/1/binary/multi\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"http://api.infobip.com/sms/1/binary/multi\\\",\\n  CURLOPT_RETURNTRANSFER => true,\\n  CURLOPT_ENCODING => \\\"\\\",\\n  CURLOPT_MAXREDIRS => 10,\\n  CURLOPT_TIMEOUT => 30,\\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\\n  CURLOPT_CUSTOMREQUEST => \\\"POST\\\",\\n  CURLOPT_POSTFIELDS => \\\"{ \\\\\\\"messages\\\\\\\":[ { \\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[ \\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026731\\\\\\\" ], \\\\\\\"binary\\\\\\\":{ \\\\\\\"hex\\\\\\\":\\\\\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\\\\\", \\\\\\\"dataCoding\\\\\\\":0, \\\\\\\"esmClass\\\\\\\":0 } }, { \\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"binary\\\\\\\":{ \\\\\\\"hex\\\\\\\":\\\\\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\\\\\", \\\\\\\"dataCoding\\\\\\\":8, \\\\\\\"esmClass\\\\\\\":0 } } ] }\\\",\\n  CURLOPT_HTTPHEADER => array(\\n    \\\"accept: application/json\\\",\\n    \\\"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    \\\"content-type: application/json\\\"\\n  ),\\n));\\n\\n$response = curl_exec($curl);\\n$err = curl_error($curl);\\n\\ncurl_close($curl);\\n\\nif ($err) {\\n  echo \\\"cURL Error #:\\\" . $err;\\n} else {\\n  echo $response;\\n}\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'uri'\\nrequire 'net/http'\\n\\nurl = URI(\\\"https://api.infobip.com/sms/1/binary/multi\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\nhttp.use_ssl = true\\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\\n\\nrequest = Net::HTTP::Post.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"content-type\\\"] = 'application/json'\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nrequest.body = \\\"{\\\\\\\"messages\\\\\\\":[{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026731\\\\\\\"], \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\\\\\", \\\\\\\"dataCoding\\\\\\\":0, \\\\\\\"esmClass\\\\\\\":0}}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\\\\\", \\\\\\\"dataCoding\\\\\\\":8, \\\\\\\"esmClass\\\\\\\":0}}]}\\\"\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPSConnection(\\\"api.infobip.com\\\")\\n\\npayload = \\\"{\\\\\\\"messages\\\\\\\":[{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026731\\\\\\\"], \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\\\\\", \\\\\\\"dataCoding\\\\\\\":0, \\\\\\\"esmClass\\\\\\\":0}}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\\\\\", \\\\\\\"dataCoding\\\\\\\":8, \\\\\\\"esmClass\\\\\\\":0}}]}\\\"\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'content-type': \\\"application/json\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"POST\\\", \\\"/sms/1/binary/multi\\\", payload, headers)\\n\\nres = conn.getresponse()\\ndata = res.read()\\n\\nprint(data.decode(\\\"utf-8\\\"))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"HttpResponse<String> response = Unirest.post(\\\"https://api.infobip.com/sms/1/binary/multi\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .body(\\\"{\\\\\\\"messages\\\\\\\":[{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026731\\\\\\\"], \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\\\\\", \\\\\\\"dataCoding\\\\\\\":0, \\\\\\\"esmClass\\\\\\\":0}}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\\\\\", \\\\\\\"dataCoding\\\\\\\":8, \\\\\\\"esmClass\\\\\\\":0}}]}\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/binary/multi\\\");\\n\\nvar request = new RestRequest(Method.POST);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nrequest.AddParameter(\\\"application/json\\\", \\\"{\\\\\\\"messages\\\\\\\":[{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026731\\\\\\\"], \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\\\\\", \\\\\\\"dataCoding\\\\\\\":0, \\\\\\\"esmClass\\\\\\\":0}}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"binary\\\\\\\":{\\\\\\\"hex\\\\\\\":\\\\\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\\\\\", \\\\\\\"dataCoding\\\\\\\":8, \\\\\\\"esmClass\\\\\\\":0}}]}\\\", ParameterType.RequestBody);\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = JSON.stringify({\\n  \\\"messages\\\": [\\n    {\\n      \\\"from\\\": \\\"InfoSMS\\\",\\n      \\\"to\\\": [\\n        \\\"41793026727\\\",\\n        \\\"41793026731\\\"\\n      ],\\n      \\\"binary\\\": {\\n        \\\"hex\\\": \\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\",\\n        \\\"dataCoding\\\": 0,\\n        \\\"esmClass\\\": 0\\n      }\\n    },\\n    {\\n      \\\"from\\\": \\\"41793026700\\\",\\n      \\\"to\\\": \\\"41793026785\\\",\\n      \\\"binary\\\": {\\n        \\\"hex\\\": \\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\",\\n        \\\"dataCoding\\\": 8,\\n        \\\"esmClass\\\": 0\\n      }\\n    }\\n  ]\\n});\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = true;\\n\\nxhr.addEventListener(\\\"readystatechange\\\", function () {\\n  if (this.readyState === this.DONE) {\\n    console.log(this.responseText);\\n  }\\n});\\n\\nxhr.open(\\\"POST\\\", \\\"https://api.infobip.com/sms/1/binary/multi\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"application/json\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n\\t\\n{  \\n   \\\"bulkId\\\":\\\"1036A4cb-803a-4a73-a5a6-7e4fc3791722\\\",\\n   \\\"messages\\\":[  \\n      {  \\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"status\\\":{  \\n            \\\"groupId\\\":7,\\n            \\\"groupName\\\":\\\"PENDING\\\",\\n            \\\"id\\\":7,\\n            \\\"name\\\":\\\"PENDING_ENROUTE\\\",\\n            \\\"description\\\":\\\"Message sent to next instance\\\"\\n         },\\n         \\\"smsCount\\\":1,\\n         \\\"messageId\\\":\\\"1254df3e-ab62-15af5-230b-14d8e65c7540\\\"\\n      },\\n      {  \\n         \\\"to\\\":\\\"41793026731\\\",\\n         \\\"status\\\":{  \\n            \\\"groupId\\\":1,\\n            \\\"groupName\\\":\\\"PENDING\\\",\\n            \\\"id\\\":7,\\n            \\\"name\\\":\\\"PENDING_ENROUTE\\\",\\n            \\\"description\\\":\\\"Message sent to next instance\\\"\\n         },\\n         \\\"smsCount\\\":1,\\n         \\\"messageId\\\":\\\"a5b7df3e-1b62-4af5-840b-1b5de65c2ad7\\\"\\n      },\\n      {  \\n         \\\"to\\\":\\\"41793026785\\\",\\n         \\\"status\\\":{  \\n            \\\"groupId\\\":1,\\n            \\\"groupName\\\":\\\"PENDING\\\",\\n            \\\"id\\\":7,\\n            \\\"name\\\":\\\"PENDING_ENROUTE\\\",\\n            \\\"description\\\":\\\"Message sent to next instance\\\"\\n         },\\n         \\\"smsCount\\\":1,\\n         \\\"messageId\\\":\\\"1877df3e-4b62-46f5-819b-14d8e65c2291\\\"\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<smsResponse>\\n   <bulkId>1036A4cb-803a-4a73-a5a6-7e4fc3791722</bulkId>\\n   <messages>\\n      <message>\\n         <to>41793026727</to>\\n         <status>\\n            <groupId>1</groupId>\\n            <groupName>PENDING</groupName>\\n            <id>7</id>\\n            <name>PENDING_ENROUTE</name>\\n            <description>Message sent to next instance</description>\\n         </status>\\n         <smsCount>1</smsCount>\\n         <messageId>1254df3e-ab62-15af5-230b-14d8e65c7540</messageId>\\n      </message>\\n      <message>\\n         <to>41793026731</to>\\n         <status>\\n            <groupId>1</groupId>\\n            <groupName>PENDING</groupName>\\n            <id>7</id>\\n            <name>PENDING_ENROUTE</name>\\n            <description>Message sent to next instance</description>\\n         </status>\\n         <smsCount>1</smsCount>\\n         <messageId>a5b7df3e-1b62-4af5-840b-1b5de65c2ad7</messageId>\\n      </message>\\n      <message>\\n         <to>41793026785</to>\\n         <status>\\n            <groupId>1</groupId>\\n            <groupName>PENDING</groupName>\\n            <id>7</id>\\n            <name>PENDING_ENROUTE</name>\\n            <description>Message sent to next instance</description>\\n         </status>\\n         <smsCount>1</smsCount>\\n         <messageId>1877df3e-4b62-46f5-819b-14d8e65c2291</messageId>\\n      </message>\\n   </messages>\\n</smsResponse>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to send multiple binary messages to one or more destination addresses.","slug":"send-multiple-binary-sms","type":"endpoint","title":"Multiple binary message"}

postMultiple binary message

This method allows you to send multiple binary messages to one or more destination addresses.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

from:
string
Represents sender ID and 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 14 characters.
to:
required
array of strings
Array of message destination addresses. If you want to send a [message to one destination](http://dev.infobip.com/v1/docs/send-single-binary-sms#section-single-binary-message-to-one-destination), a single String is supported instead of an Array. Destination addresses must be in international format (Example: `41793026727`).
hex:
string
Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by space character (Example: `"0f c2 4a bf 34 13 ba"`).
dataCoding:
integer
Binary content data coding. Default value is (`0`) for GSM7. Example: (`8`) for Unicode data.
esmClass:
integer
“Esm_class” parameter. Indicate a special message attributes associated with the SMS. Default value is `(0)`.

Examples


Result Format


Documentation

# Response format If successful, response header HTTP status code will be `200 OK` and the messages will be sent. If you try to send messages without authorization, you will receive an error `401 Unauthorized`. ## SMSResponse |Parameter|Type|Description| |-|-|-| |*bulkId*|String|The ID that uniquely identifies the request. Bulk ID will be received only when you send the message to [more than one destination address](#section-multiple-binary-messages-to-multiple-destinations).| |*messages*|[SMSResponseDetails](#section-sendsmsresponsedetails)[]|Array of sent message objects, one object per every message.| ### SMSResponseDetails |Parameter|Type|Description| |-|-|-| |*to*|String|The message destination address.| |*status*|[Status](#section-status)|Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.| |*smsCount*|int|The number of sent message segments.| |*messageId*|String|The ID that uniquely identifies the message sent.| #### Status |Parameter|Type|Description| |-|-|-| |*groupId*|int|Status [group ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*groupName*|String|Status [group name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*id*|int|Status [ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*name*|String|Status [name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*description*|String|Human readable [description](http://dev.infobip.com/v1/docs/response-codes#status-object-example) of the status.| |*action*|String|[Action](http://dev.infobip.com/v1/docs/response-codes#status-object-example) that should be taken to eliminate the error.| [block:callout] { "type": "info", "body": "Find out more about Data coding and Esm_class usage [here](http://www.3gpp.org/DynaReport/23038.htm).", "title": "Note:" } [/block] [block:api-header] { "type": "basic", "title": "Additional examples" } [/block] # Multiple binary messages to multiple destinations **Request** [block:code] { "codes": [ { "code": "POST /sms/1/binary/multi HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json\nContent-Type: application/json\n\n{\n\t\"messages\":[\n\t\t{\n\t\t\t\"from\":\"InfoSMS\",\n\t\t\t\"to\":[\n\t\t\t\t\"41793026727\",\n\t\t\t\t\"41793026731\"\n\t\t\t],\n\t\t\t\"binary\":{\n\t\t\t\t\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\n\t\t\t\t\"dataCoding\":0,\n\t\t\t\t\"esmClass\":0\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"from\":\"41793026700\",\n\t\t\t\"to\":\"41793026785\",\n\t\t\t\"binary\":{\n\t\t\t\t\"hex\":\"6d 4b 8B d5 77 ed 4f e1 30 02\",\n\t\t\t\t\"dataCoding\":8,\n\t\t\t\t\"esmClass\":0\n\t\t\t}\n\t\t}\n\t]\n}", "language": "json" }, { "code": "POST /sms/1/binary/multi HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\nAccept: application/xml\n\n<request>\n <messages>\n <message>\n <from>InfoSMS</from>\n <to>\n <to>41793026727</to>\n <to>41793026731</to>\n </to>\n <binary>\n <hex>54 65 73 74 20 6d 65 73 73 61 67 65 2e</hex>\n <dataCoding>0</dataCoding>\n <esmClass>0</esmClass>\n </binary>\n </message>\n <message>\n <from>41793026700</from>\n <to>\n <to>41793026785</to>\n </to>\n <binary>\n <hex>6d 4b 8B d5 77 ed 4f e1 30 02</hex>\n <dataCoding>8</dataCoding>\n <esmClass>0</esmClass>\n </binary>\n </message>\n </messages>\n</request>", "language": "xml" }, { "code": "curl -X POST \\\n-H 'Content-Type: application/json' \\\n-H 'Accept: application/json' \\\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\n-d '{ \n \"messages\":[ \n { \n \"from\":\"InfoSMS\",\n \"to\":[ \n \"41793026727\",\n \"41793026731\"\n ],\n \"binary\":{ \n \"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\n \"dataCoding\":0,\n \"esmClass\":0\n }\n },\n { \n \"from\":\"41793026700\",\n \"to\":\"41793026785\",\n \"binary\":{ \n \"hex\":\"6d 4b 8B d5 77 ed 4f e1 30 02\",\n \"dataCoding\":8,\n \"esmClass\":0\n }\n }\n ]\n}' https://api.infobip.com/sms/1/binary/multi", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/sms/1/binary/multi\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"{ \\\"messages\\\":[ { \\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[ \\\"41793026727\\\", \\\"41793026731\\\" ], \\\"binary\\\":{ \\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\", \\\"dataCoding\\\":0, \\\"esmClass\\\":0 } }, { \\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"binary\\\":{ \\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\", \\\"dataCoding\\\":8, \\\"esmClass\\\":0 } } ] }\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n \"content-type: application/json\"\n ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}", "language": "php" }, { "code": "require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/sms/1/binary/multi\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"content-type\"] = 'application/json'\nrequest[\"accept\"] = 'application/json'\n\nrequest.body = \"{\\\"messages\\\":[{\\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[\\\"41793026727\\\", \\\"41793026731\\\"], \\\"binary\\\":{\\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\", \\\"dataCoding\\\":0, \\\"esmClass\\\":0}}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"binary\\\":{\\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\", \\\"dataCoding\\\":8, \\\"esmClass\\\":0}}]}\"\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\npayload = \"{\\\"messages\\\":[{\\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[\\\"41793026727\\\", \\\"41793026731\\\"], \\\"binary\\\":{\\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\", \\\"dataCoding\\\":0, \\\"esmClass\\\":0}}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"binary\\\":{\\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\", \\\"dataCoding\\\":8, \\\"esmClass\\\":0}}]}\"\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'content-type': \"application/json\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"POST\", \"/sms/1/binary/multi\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.post(\"https://api.infobip.com/sms/1/binary/multi\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .header(\"accept\", \"application/json\")\n .body(\"{\\\"messages\\\":[{\\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[\\\"41793026727\\\", \\\"41793026731\\\"], \\\"binary\\\":{\\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\", \\\"dataCoding\\\":0, \\\"esmClass\\\":0}}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"binary\\\":{\\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\", \\\"dataCoding\\\":8, \\\"esmClass\\\":0}}]}\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/binary/multi\");\n\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddParameter(\"application/json\", \"{\\\"messages\\\":[{\\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[\\\"41793026727\\\", \\\"41793026731\\\"], \\\"binary\\\":{\\\"hex\\\":\\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\", \\\"dataCoding\\\":0, \\\"esmClass\\\":0}}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"binary\\\":{\\\"hex\\\":\\\"6d 4b 8B d5 77 ed 4f e1 30 02\\\", \\\"dataCoding\\\":8, \\\"esmClass\\\":0}}]}\", ParameterType.RequestBody);\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = JSON.stringify({\n \"messages\": [\n {\n \"from\": \"InfoSMS\",\n \"to\": [\n \"41793026727\",\n \"41793026731\"\n ],\n \"binary\": {\n \"hex\": \"54 65 73 74 20 6d 65 73 73 61 67 65 2e\",\n \"dataCoding\": 0,\n \"esmClass\": 0\n }\n },\n {\n \"from\": \"41793026700\",\n \"to\": \"41793026785\",\n \"binary\": {\n \"hex\": \"6d 4b 8B d5 77 ed 4f e1 30 02\",\n \"dataCoding\": 8,\n \"esmClass\": 0\n }\n }\n ]\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"POST\", \"https://api.infobip.com/sms/1/binary/multi\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\t\n{ \n \"bulkId\":\"1036A4cb-803a-4a73-a5a6-7e4fc3791722\",\n \"messages\":[ \n { \n \"to\":\"41793026727\",\n \"status\":{ \n \"groupId\":7,\n \"groupName\":\"PENDING\",\n \"id\":7,\n \"name\":\"PENDING_ENROUTE\",\n \"description\":\"Message sent to next instance\"\n },\n \"smsCount\":1,\n \"messageId\":\"1254df3e-ab62-15af5-230b-14d8e65c7540\"\n },\n { \n \"to\":\"41793026731\",\n \"status\":{ \n \"groupId\":1,\n \"groupName\":\"PENDING\",\n \"id\":7,\n \"name\":\"PENDING_ENROUTE\",\n \"description\":\"Message sent to next instance\"\n },\n \"smsCount\":1,\n \"messageId\":\"a5b7df3e-1b62-4af5-840b-1b5de65c2ad7\"\n },\n { \n \"to\":\"41793026785\",\n \"status\":{ \n \"groupId\":1,\n \"groupName\":\"PENDING\",\n \"id\":7,\n \"name\":\"PENDING_ENROUTE\",\n \"description\":\"Message sent to next instance\"\n },\n \"smsCount\":1,\n \"messageId\":\"1877df3e-4b62-46f5-819b-14d8e65c2291\"\n }\n ]\n}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<smsResponse>\n <bulkId>1036A4cb-803a-4a73-a5a6-7e4fc3791722</bulkId>\n <messages>\n <message>\n <to>41793026727</to>\n <status>\n <groupId>1</groupId>\n <groupName>PENDING</groupName>\n <id>7</id>\n <name>PENDING_ENROUTE</name>\n <description>Message sent to next instance</description>\n </status>\n <smsCount>1</smsCount>\n <messageId>1254df3e-ab62-15af5-230b-14d8e65c7540</messageId>\n </message>\n <message>\n <to>41793026731</to>\n <status>\n <groupId>1</groupId>\n <groupName>PENDING</groupName>\n <id>7</id>\n <name>PENDING_ENROUTE</name>\n <description>Message sent to next instance</description>\n </status>\n <smsCount>1</smsCount>\n <messageId>a5b7df3e-1b62-4af5-840b-1b5de65c2ad7</messageId>\n </message>\n <message>\n <to>41793026785</to>\n <status>\n <groupId>1</groupId>\n <groupName>PENDING</groupName>\n <id>7</id>\n <name>PENDING_ENROUTE</name>\n <description>Message sent to next instance</description>\n </status>\n <smsCount>1</smsCount>\n <messageId>1877df3e-4b62-46f5-819b-14d8e65c2291</messageId>\n </message>\n </messages>\n</smsResponse>", "language": "xml" } ] } [/block]