{"_id":"560a45877c5c040d00422614","project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","__v":4,"editedParams2":true,"parentDoc":null,"category":{"_id":"555d9b4106dfec0d00d38ea7","project":"54eb50e5615ffc1900305a16","pages":["5565c1f35561af0d00820664","55812f9aa5474a0d00d943ee","560a45877c5c040d00422614"],"version":"54eb63b859b1172100334fae","__v":3,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-05-21T08:45:53.652Z","from_sync":false,"order":4,"slug":"advanced-sms-methods","title":"Advanced SMS methods"},"editedParams":true,"version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":26,"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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-29T08:02:15.209Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"HTTP/1.1 200 OK\nContent-Type: application/json\n\n{  \n   \"bulkId\": \"BULK-ID-123-xyz\",\n   \"messages\":[  \n      {  \n         \"to\":\"41793026727\",\n         \"status\":{  \n            \"groupId\":0,\n            \"groupName\":\"ACCEPTED\",\n            \"id\":0,\n            \"name\":\"MESSAGE_ACCEPTED\",\n            \"description\":\"Message accepted\"\n         },\n         \"smsCount\":1,\n         \"messageId\":\"MESSAGE-ID-123-xyz\"\n      },\n      {  \n         \"to\":\"41793026731\",\n         \"status\":{  \n            \"groupId\":0,\n            \"groupName\":\"ACCEPTED\",\n            \"id\":0,\n            \"name\":\"MESSAGE_ACCEPTED\",\n            \"description\":\"Message accepted\"\n         },\n         \"smsCount\":1,\n         \"messageId\":\"9304a5a3ab19-1ca1-be74-76ad87651ed25f35\"\n      },\n      {  \n         \"to\":\"41793026785\",\n         \"status\":{  \n            \"groupId\":0,\n            \"groupName\":\"ACCEPTED\",\n            \"id\":0,\n            \"name\":\"MESSAGE_ACCEPTED\",\n            \"description\":\"Message accepted\"\n         },\n         \"smsCount\":2,\n         \"messageId\":\"5f35f87a2f19-a141-43a4-91cd81b85f8c689\"\n      }\n   ]\n}","name":"OK - JSON"},{"name":"OK - XML","code":"HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<smsResponse>\n   <bulkId>BULK-ID-123-xyz</bulkId>\n   <messages>\n      <message>\n         <to>41793026727</to>\n         <status>\n            <groupId>0</groupId>\n            <groupName>ACCEPTED</groupName>\n            <id>0</id>\n            <name>MESSAGE_ACCEPTED</name>\n            <description>Message accepted</description>\n         </status>\n         <smsCount>1</smsCount>\n         <messageId>MESSAGE-ID-123-xyz</messageId>\n      </message>\n      <message>\n         <to>41793026731</to>\n         <status>\n            <groupId>0</groupId>\n            <groupName>ACCEPTED</groupName>\n            <id>0</id>\n            <name>MESSAGE_ACCEPTED</name>\n            <description>Message accepted</description>\n         </status>\n         <smsCount>1</smsCount>\n         <messageId>9304a5a3ab19-1ca1-be74-76ad87651ed25f35</messageId>\n      </message>\n      <message>\n         <to>41793026785</to>\n         <status>\n            <groupId>0</groupId>\n            <groupName>ACCEPTED</groupName>\n            <id>0</id>\n            <name>MESSAGE_ACCEPTED</name>\n            <description>Message accepted</description>\n         </status>\n         <smsCount>2</smsCount>\n         <messageId>5f35f87a2f19-a141-43a4-91cd81b85f8c689</messageId>\n      </message>\n   </messages>\n</smsResponse>","language":"xml","status":200}]},"settings":"554860d6d2c8410d006c215e","examples":{"codes":[{"language":"json","code":"POST /sms/1/binary/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n   \"bulkId\":\"BULK-ID-123-xyz\",\n   \"messages\":[\n      {\n         \"from\":\"InfoSMS\",\n         \"destinations\":[\n            {\n               \"to\":\"41793026727\",\n               \"messageId\":\"MESSAGE-ID-123-xyz\"\n            },\n            {\n               \"to\":\"41793026731\"\n            }\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         \"intermediateReport\":true,\n         \"notifyUrl\":\"http://www.example.com/sms/advanced\",\n         \"notifyContentType\":\"application/json\",\n         \"callbackData\":\"DLR callback data\",\n         \"validityPeriod\": 720\n      },\n      {\n         \"from\":\"41793026700\",\n         \"destinations\":[\n            {\n               \"to\":\"41793026785\"\n            }\n         ],\n         \"binary\":{  \n            \"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\",\n            \"dataCoding\":0,\n            \"esmClass\":0\n         },\n  \t\t\t \"sendAt\":\"2015-09-29T17:00:00.000+01:00\"\n      }\n   ]\n}"},{"code":"POST /sms/1/binary/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\n\n<request>\n\t<bulkId>BULK-ID-123-xyz</bulkId>\n\t<messages>\n    <message>\n      <from>InfoSMS</from>\n      <destinations>\n        <destination>\n        \t<to>41793026727</to>\n        \t<messageId>MESSAGE-ID-123-xyz</messageId>\n        </destination>\n        <destination>\n          <to>41793026731</to>\n        </destination>\n      </destinations>\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      <notifyUrl>http://www.example.com/sms/advanced</notifyUrl>\n      <notifyContentType>application/json</notifyContentType>\n      <callbackData>DLR callback data</callbackData>\n      <validityPeriod>720</validityPeriod>\n\t\t</message>\n\t\t<message>\n      <from>41793026700</from>\n      <destinations>\n        <destination>\n        \t<to>41793026785</to>\n        </destination>\n      </destinations>\n      <binary>\n        <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>\n        <dataCoding>0</dataCoding>\n        <esmClass>0</esmClass>\n      </binary>\n      <sendAt>2015-09-29T17:00:00.000+01:00</sendAt>\n\t\t</message>\n  </messages>\n</request>","language":"xml"},{"code":"curl -X \"POST\" \"https://api.infobip.com/sms/1/binary/advanced\" \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== \" \\\n\t-H \"Content-Type: application/json; charset=UTF-8\" \\\n\t-d $'{\n   \"bulkId\":\"BULK-ID-123-xyz\",\n   \"messages\":[\n      {\n         \"from\":\"InfoSMS\",\n         \"destinations\":[\n            {\n               \"to\":\"41793026727\",\n               \"messageId\":\"MESSAGE-ID-123-xyz\"\n            },\n            {\n               \"to\":\"41793026731\"\n            }\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         \"notifyUrl\":\"http://www.example.com/sms/advanced\",\n         \"notifyContentType\":\"application/json\",\n         \"callbackData\":\"DLR callback data\",\n         \"validityPeriod\": 720\n      },\n      {\n         \"from\":\"41793026700\",\n         \"destinations\":[\n            {\n               \"to\":\"41793026785\"\n            }\n         ],\n         \"binary\":{  \n            \"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\",\n            \"dataCoding\":0,\n            \"esmClass\":0\n         },\n  \t\t\t \"sendAt\":\"2015-09-29T17:00:00.000+01:00\"\n      }\n   ]\n}'","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/advanced\",\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 => \"{ \\\"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\\\":\\\"http://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\\\" } ] }\",\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}","name":"PHP","language":"php"},{"language":"ruby","name":"Ruby","code":"require 'net/http'\nrequire 'json'\n\ndef send_request\n  begin\n    uri = URI('https://api.infobip.com/sms/1/binary/advanced')\n\n    # Create client\n    http = Net::HTTP.new(uri.host, uri.port)\n\n    dict = {\n            \"bulkId\" => \"BULK-ID-123-xyz\",\n            \"messages\" => [\n                {\n                    \"from\" => \"InfoSMS\",\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                    \"callbackData\" => \"DLR callback data\",\n                    \"notifyUrl\" => \"http://www.example.com/sms/advanced\",\n                    \"notifyContentType\" => \"application/json\",\n                    \"destinations\" => [\n                        {\n                            \"to\" => \"41793026727\",\n                            \"messageId\" => \"MESSAGE-ID-123-xyz\"\n                        },\n                        {\n                            \"to\" => \"41793026731\"\n                        }\n                    ],\n                    \"validityPeriod\" => 720\n                },\n                {\n                    \"binary\" => {\n                        \"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\",\n                        \"dataCoding\" => 0,\n                        \"esmClass\" => 0\n                    },\n                    \"destinations\" => [\n                        {\n                            \"to\" => \"41793026785\"\n                        }\n                    ],\n                    \"sendAt\" => \"2015-09-29T17:00:00.000+01:00\",\n                    \"from\" => \"41793026700\"\n                }\n            ]\n        }\n    body = JSON.dump(dict)\n\n    # Create Request\n    req =  Net::HTTP::Post.new(uri)\n    # Add headers\n    req.add_field \"Accept\", \"application/json\"\n    req.add_field \"Authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== \"\n    req.add_field \"Content-Type\", \"application/json; charset=UTF-8\"\n    # Set body\n    req.body = body\n\n    # Fetch Request\n    res = http.request(req)\n    puts \"Response HTTP Status Code: #{res.code}\"\n    puts \"Response HTTP Response Body: #{res.body}\"\n  rescue Exception => e\n    puts \"HTTP Request failed (#{e.message})\"\n  end\nend\n"},{"language":"python","code":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\npayload = \"{\\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\\"messages\\\": [{\\\"from\\\": \\\"InfoSMS\\\",\\\"binary\\\": {\\\"hex\\\": \\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\",\\\"dataCoding\\\": 0,\\\"esmClass\\\": 0},\\\"callbackData\\\": \\\"DLR callback data\\\",\\\"notifyUrl\\\": \\\"http://www.example.com/sms/advanced\\\",\\\"notifyContentType\\\": \\\"application/json\\\",\\\"destinations\\\": [{\\\"to\\\": \\\"41793026727\\\",\\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"},{\\\"to\\\": \\\"41793026731\\\"}],\\\"validityPeriod\\\": 720},{\\\"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},\\\"destinations\\\": [{\\\"to\\\": \\\"41793026785\\\"}],\\\"sendAt\\\": \\\"2015-09-29T17:00:00.000+01:00\\\",\\\"from\\\": \\\"41793026700\\\"}]}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n    'accept': \"application/json\"\n    }\n\nconn.request(\"POST\", \"/sms/1/binary/advanced\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"code":"HttpResponse<String> response = Unirest.post(\"https://api.infobip.com/sms/1/binary/advanced\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n  .header(\"accept\", \"application/json\")\n  .body(\"{\\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\\"messages\\\": [{\\\"from\\\": \\\"InfoSMS\\\",\\\"binary\\\": {\\\"hex\\\": \\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\",\\\"dataCoding\\\": 0,\\\"esmClass\\\": 0},\\\"callbackData\\\": \\\"DLR callback data\\\",\\\"notifyUrl\\\": \\\"http://www.example.com/sms/advanced\\\",\\\"notifyContentType\\\": \\\"application/json\\\",\\\"destinations\\\": [{\\\"to\\\": \\\"41793026727\\\",\\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"},{\\\"to\\\": \\\"41793026731\\\"}],\\\"validityPeriod\\\": 720},{\\\"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},\\\"destinations\\\": [{\\\"to\\\": \\\"41793026785\\\"}],\\\"sendAt\\\": \\\"2015-09-29T17:00:00.000+01:00\\\",\\\"from\\\": \\\"41793026700\\\"}]}\")\n  .asString();","language":"java"},{"language":"csharp","code":"var client = new RestClient(\"https://api.infobip.com/sms/1/binary/advanced\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\\"messages\\\": [{\\\"from\\\": \\\"InfoSMS\\\",\\\"binary\\\": {\\\"hex\\\": \\\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\\\",\\\"dataCoding\\\": 0,\\\"esmClass\\\": 0},\\\"callbackData\\\": \\\"DLR callback data\\\",\\\"notifyUrl\\\": \\\"http://www.example.com/sms/advanced\\\",\\\"notifyContentType\\\": \\\"application/json\\\",\\\"destinations\\\": [{\\\"to\\\": \\\"41793026727\\\",\\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"},{\\\"to\\\": \\\"41793026731\\\"}],\\\"validityPeriod\\\": 720},{\\\"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},\\\"destinations\\\": [{\\\"to\\\": \\\"41793026785\\\"}],\\\"sendAt\\\": \\\"2015-09-29T17:00:00.000+01:00\\\",\\\"from\\\": \\\"41793026700\\\"}]}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"language":"javascript","code":"var data = JSON.stringify({\n  \"bulkId\": \"BULK-ID-123-xyz\",\n  \"messages\": [\n    {\n      \"from\": \"InfoSMS\",\n      \"destinations\": [\n        {\n          \"to\": \"41793026727\",\n          \"messageId\": \"MESSAGE-ID-123-xyz\"\n        },\n        {\n          \"to\": \"41793026731\"\n        }\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      \"notifyUrl\": \"http://www.example.com/sms/advanced\",\n      \"notifyContentType\": \"application/json\",\n      \"callbackData\": \"DLR callback data\",\n      \"validityPeriod\": 720\n    },\n    {\n      \"from\": \"41793026700\",\n      \"destinations\": [\n        {\n          \"to\": \"41793026785\"\n        }\n      ],\n      \"binary\": {\n        \"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\",\n        \"dataCoding\": 0,\n        \"esmClass\": 0\n      },\n      \"sendAt\": \"2015-09-29T17:00:00.000+01:00\"\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/advanced\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);"}]},"method":"post","auth":"required","params":[{"_id":"554a16e4b9fb933900cc74d0","ref":"","in":"body","required":false,"desc":"The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to [more than one destination address](#section-multiple-textual-messages-to-multiple-destinations).","default":"","type":"string","name":"bulkId"},{"_id":"55156711bc466623002afe91","ref":"","in":"body","required":false,"desc":"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.","default":"","type":"string","name":"from"},{"_id":"555d8ce08ab3180d001ac4a4","ref":"","in":"body","required":true,"desc":"Message destination address. Addresses must be in international format (Example: `41793026727`).","default":"","type":"string","name":"to"},{"_id":"555d8ce08ab3180d001ac4a3","ref":"","in":"body","required":false,"desc":"The ID that uniquely identifies the message sent.","default":"","type":"string","name":"messageId"},{"_id":"55156711bc466623002afe8f","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":"560a463d87b71d0d000d3a5d","ref":"","in":"body","required":false,"desc":"Binary content data coding. Default value is (`0`) for GSM7. Example: (`8`) for  [Unicode](doc:unicode-messages) data.","default":"0","type":"int","name":"dataCoding"},{"_id":"560a463d87b71d0d000d3a5c","ref":"","in":"body","required":false,"desc":"“Esm_class” parameter. Indicate a special message attributes associated with the SMS. Default value is `(0)`.","default":"0","type":"int","name":"esmClass"},{"_id":"555c52747e271d0d00f3c8d7","ref":"","in":"body","required":false,"desc":"Can be `true` or `false`. If the value is set to `true`, a [flash SMS](doc:flash-sms) will be sent. Otherwise, a normal SMS will be sent. The default value is `false`.","default":"false","type":"boolean","name":"flash"},{"_id":"5624d6235a86b423009462da","ref":"","in":"body","required":false,"desc":"The real-time Intermediate delivery report that will be sent on your callback server.","default":"","type":"boolean","name":"intermediateReport"},{"_id":"555c7cf07e271d0d00f3c91a","ref":"","in":"body","required":false,"desc":"The URL on your call back server on which the [Delivery report](http://dev.infobip.com/v1/docs/delivery-reports) will be sent.","default":"","type":"string","name":"notifyUrl"},{"_id":"555c7cf07e271d0d00f3c919","ref":"","in":"body","required":false,"desc":"Preferred Delivery report content type. Can be `application/json` or `application/xml`.","default":"","type":"string","name":"notifyContentType"},{"_id":"555c7cf07e271d0d00f3c918","ref":"","in":"body","required":false,"desc":"Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters.","default":"","type":"string","name":"callbackData"},{"_id":"5565c2cb5561af0d00820666","ref":"","in":"body","required":false,"desc":"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).","default":"","type":"int","name":"validityPeriod"},{"_id":"5565c2cb5561af0d00820665","ref":"","in":"body","required":false,"desc":"Date and time when the message is to be sent. Used for scheduled SMS (SMS not sent immediately, but at scheduled time).","default":"","type":"datetime","name":"sendAt"}],"url":"/sms/:version/binary/advanced"},"isReference":true,"order":1,"body":"# Fully featured binary message tutorials:\n\n- **[Custom bulk id and message id](doc:bulk-id-and-message-id)**\n- **[Schedule SMS and Validity period](doc:schedule-sms)**  \n- **[Intermediate delivery reports](doc:intermediate-delivery-reports)**\n- **[Delivery reports on Notify URL](doc:notify-url)** \n\n# Response format \n\nIf successful, response header HTTP status code will be `200 OK` and the message will be sent.\n\nIf you try to send the message without authorization, you will receive an `401 Unauthorized` error .\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 a message is sent to [more than one destination address](doc:sms-to-multiple-destinations).|\n|*messages*|[SMSResponseDetails[]](#section-smsresponsedetails)|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  sent successfully, 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 sent message.|\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.|","excerpt":"Send advanced binary SMS with the all available features and parameters.","slug":"fully-featured-binary-message","type":"endpoint","title":"Fully featured binary message"}

postFully featured binary message

Send advanced binary SMS with the all available features and parameters.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

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](#section-multiple-textual-messages-to-multiple-destinations).
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:
required
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 space character (Example: `"0f c2 4a bf 34 13 ba"`).
dataCoding:
integer0
Binary content data coding. Default value is (`0`) for GSM7. Example: (`8`) for [Unicode](doc:unicode-messages) data.
esmClass:
integer0
“Esm_class” parameter. Indicate a special message attributes associated with the SMS. Default value is `(0)`.
flash:
booleanfalse
Can be `true` or `false`. If the value is set to `true`, a [flash SMS](doc: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](http://dev.infobip.com/v1/docs/delivery-reports) 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:
integer
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 scheduled time).

Examples


Result Format


Documentation

# Fully featured binary message tutorials: - **[Custom bulk id and message id](doc:bulk-id-and-message-id)** - **[Schedule SMS and Validity period](doc:schedule-sms)** - **[Intermediate delivery reports](doc:intermediate-delivery-reports)** - **[Delivery reports on Notify URL](doc:notify-url)** # Response format If successful, 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 an `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](doc:sms-to-multiple-destinations).| |*messages*|[SMSResponseDetails[]](#section-smsresponsedetails)|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 sent successfully, 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 sent message.| #### 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.|