{"__v":3,"_id":"55156601fd26132300e74e40","category":{"__v":12,"_id":"55153a6de68daa2f00cff838","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":1,"slug":"send-sms","title":"Send SMS"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","version":{"__v":21,"_id":"54eb63b859b1172100334fae","forked_from":"54eb63a1867e1917009b711d","project":"54eb50e5615ffc1900305a16","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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":["5881d2fabc00701b00a6ce58"],"next":{"pages":[],"description":""},"createdAt":"2015-03-27T14:15:29.252Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"POST /sms/1/text/multi HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\n{  \n   \"messages\":[  \n      {  \n         \"from\":\"InfoSMS\",\n         \"to\":[  \n            \"41793026727\",\n            \"41793026731\"\n         ],\n         \"text\":\"May the Force be with you!\"\n      },\n      {  \n         \"from\":\"41793026700\",\n         \"to\":\"41793026785\",\n         \"text\":\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\"\n      }\n   ]\n}","language":"json"}]},"method":"post","results":{"codes":[{"status":200,"language":"json","code":"{  \n   \"bulkId\":\"5028e2d42f19-42f1-4656-351e-a42c191e5fd2\",\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\":\"4242f196ba50-a356-2f91-831c4aa55f351ed2\"\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\":\"5f35f896ba50-a356-43a4-91cd81b85f8c689\"\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}\n\n","name":""}]},"settings":"554860d6d2c8410d006c215e","auth":"required","params":[{"_id":"55156711bc466623002afe91","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":"55156711bc466623002afe90","ref":"","in":"body","required":true,"desc":"Array of message destination addresses. If you want to send a 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":"55156711bc466623002afe8f","ref":"","in":"body","required":false,"desc":"Text of the message that will be sent.","default":"","type":"string","name":"text"}],"url":"/sms/:version/text/multi"},"isReference":true,"order":1,"body":"# 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 message 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 a message to [more than one destination address](#section-multiple-textual-messages-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 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\": \"Maximum length for one message is 160 characters for GSM7 standard or 70 characters Unicode encoded messages. If you send text which exceeds the maximum number of supported characters for one message, the sent message will be [segmented and charged accordingly](doc:long-sms). One Long SMS that consists of two SMS [counts as two SMS](doc:long-sms).\",\n  \"title\": \"Long SMS\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional examples\"\n}\n[/block]\n# Multiple textual messages to multiple destinations\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /sms/1/text/multi HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\\n\\n{  \\n   \\\"messages\\\":[  \\n      {  \\n         \\\"from\\\":\\\"InfoSMS\\\",\\n         \\\"to\\\":[  \\n            \\\"41793026727\\\",\\n            \\\"41793026731\\\"\\n         ],\\n         \\\"text\\\":\\\"May the Force be with you!\\\"\\n      },\\n      {  \\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"to\\\":\\\"41793026785\\\",\\n         \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"POST /sms/1/text/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         <text>May the Force be with you!</text>\\n      </message>\\n      <message>\\n         <from>41793026700</from>\\n         <to>\\n            <to>41793026785</to>\\n         </to>\\n         <text>A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.</text>\\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         \\\"text\\\":\\\"May the Force be with you!\\\"\\n      },\\n      {  \\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"to\\\":\\\"41793026785\\\",\\n         \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"\\n      }\\n   ]\\n}' https://api.infobip.com/sms/1/text/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/text/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\\\\\\\" ], \\\\\\\"text\\\\\\\":\\\\\\\"May the Force be with you!\\\\\\\" }, { \\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"text\\\\\\\":\\\\\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\\\\\" } ] }\\\",\\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/text/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\\\\\\\"], \\\\\\\"text\\\\\\\":\\\\\\\"May the Force be with you!\\\\\\\"}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\",\\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"text\\\\\\\":\\\\\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\\\\\"}]}\\\"\\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\\\\\\\"], \\\\\\\"text\\\\\\\":\\\\\\\"May the Force be with you!\\\\\\\"}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"text\\\\\\\":\\\\\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\\\\\"}]}\\\"\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'content-type': \\\"application/json\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"POST\\\", \\\"/sms/1/text/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/text/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\\\\\\\"], \\\\\\\"text\\\\\\\":\\\\\\\"May the Force be with you!\\\\\\\"}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"text\\\\\\\":\\\\\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\\\\\"}]}\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/text/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\\\\\\\"], \\\\\\\"text\\\\\\\":\\\\\\\"May the Force be with you!\\\\\\\"}, {\\\\\\\"from\\\\\\\":\\\\\\\"41793026700\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026785\\\\\\\", \\\\\\\"text\\\\\\\":\\\\\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\\\\\"}]}\\\", 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      \\\"text\\\": \\\"May the Force be with you!\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"41793026700\\\",\\n      \\\"to\\\": \\\"41793026785\\\",\\n      \\\"text\\\": \\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"\\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/text/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\\n{  \\n   \\\"bulkId\\\":\\\"5028e2d42f19-42f1-4656-351e-a42c191e5fd2\\\",\\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\\\":\\\"4242f196ba50-a356-2f91-831c4aa55f351ed2\\\"\\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}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<smsResponse>\\n   <bulkId>7241ea9b2ca9-a11f-42c6-aa1e-83cd11c75f52</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>4242f196ba50-a356-2f91-831c4aa55f351ed2</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>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to send multiple textual messages to one or more destination addresses.","slug":"send-multiple-sms","type":"endpoint","title":"Multiple textual message"}

postMultiple textual message

This method allows you to send multiple textual 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, a single String is supported instead of an Array. Destination addresses must be in international format (Example: `41793026727`).
text:
string
Text of the message that will be sent.

Examples


Result Format


Documentation

# Response format If successful, response header HTTP status code will be `200 OK` and the message will be sent. If you try to send message 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 a message to [more than one destination address](#section-multiple-textual-messages-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 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": "Maximum length for one message is 160 characters for GSM7 standard or 70 characters Unicode encoded messages. If you send text which exceeds the maximum number of supported characters for one message, the sent message will be [segmented and charged accordingly](doc:long-sms). One Long SMS that consists of two SMS [counts as two SMS](doc:long-sms).", "title": "Long SMS" } [/block] [block:api-header] { "type": "basic", "title": "Additional examples" } [/block] # Multiple textual messages to multiple destinations **Request** [block:code] { "codes": [ { "code": "POST /sms/1/text/multi HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\n{ \n \"messages\":[ \n { \n \"from\":\"InfoSMS\",\n \"to\":[ \n \"41793026727\",\n \"41793026731\"\n ],\n \"text\":\"May the Force be with you!\"\n },\n { \n \"from\":\"41793026700\",\n \"to\":\"41793026785\",\n \"text\":\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\"\n }\n ]\n}", "language": "json" }, { "code": "POST /sms/1/text/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 <text>May the Force be with you!</text>\n </message>\n <message>\n <from>41793026700</from>\n <to>\n <to>41793026785</to>\n </to>\n <text>A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.</text>\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 \"text\":\"May the Force be with you!\"\n },\n { \n \"from\":\"41793026700\",\n \"to\":\"41793026785\",\n \"text\":\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\"\n }\n ]\n}' https://api.infobip.com/sms/1/text/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/text/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\\\" ], \\\"text\\\":\\\"May the Force be with you!\\\" }, { \\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\" } ] }\",\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/text/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\\\"], \\\"text\\\":\\\"May the Force be with you!\\\"}, {\\\"from\\\":\\\"41793026700\\\",\\\"to\\\":\\\"41793026785\\\", \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"}]}\"\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\\\"], \\\"text\\\":\\\"May the Force be with you!\\\"}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"}]}\"\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'content-type': \"application/json\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"POST\", \"/sms/1/text/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/text/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\\\"], \\\"text\\\":\\\"May the Force be with you!\\\"}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"}]}\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/text/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\\\"], \\\"text\\\":\\\"May the Force be with you!\\\"}, {\\\"from\\\":\\\"41793026700\\\", \\\"to\\\":\\\"41793026785\\\", \\\"text\\\":\\\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\\\"}]}\", 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 \"text\": \"May the Force be with you!\"\n },\n {\n \"from\": \"41793026700\",\n \"to\": \"41793026785\",\n \"text\": \"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\"\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/text/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\n{ \n \"bulkId\":\"5028e2d42f19-42f1-4656-351e-a42c191e5fd2\",\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\":\"4242f196ba50-a356-2f91-831c4aa55f351ed2\"\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}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<smsResponse>\n <bulkId>7241ea9b2ca9-a11f-42c6-aa1e-83cd11c75f52</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>4242f196ba50-a356-2f91-831c4aa55f351ed2</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" } ] } [/block]