{"_id":"55155f2abc466623002afe88","editedParams2":true,"parentDoc":null,"project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":28,"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","59b8eeeb707542001076d3b6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"editedParams":true,"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"},"__v":2,"updates":["5881cfd01eb3be1b006d63a9"],"next":{"pages":[],"description":""},"createdAt":"2015-03-27T13:46:18.250Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","status":200,"language":"json","code":"{  \n   \"messages\":[  \n      {  \n         \"to\":\"41793026727\",\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\": \"2033247207850523790\"\n      }\n   ]\n}"}]},"settings":"","examples":{"codes":[{"name":"","code":"POST /sms/1/text/single HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\n{  \n   \"from\":\"InfoSMS\",\n   \"to\":\"41793026727\",\n   \"text\":\"Test SMS.\"\n}","language":"json"}]},"method":"post","auth":"required","params":[{"_id":"55155f2abc466623002afe8b","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":"55155f2abc466623002afe8a","ref":"","in":"body","required":true,"desc":"Array of message destination addresses. If you want to send a [message to one destination](#section-single-textual-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":"55155f2abc466623002afe89","ref":"","in":"body","required":false,"desc":"Text of the message that will be sent.","default":"","type":"string","name":"text"}],"url":"/sms/:version/text/single"},"isReference":true,"order":0,"body":"# Response format\n\nOn success, 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-single-textual-message-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#section-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  \"title\": \"Long SMS:\",\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}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional examples\"\n}\n[/block]\n# Single textual message to one destination\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /sms/1/text/single HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\\n\\n{  \\n   \\\"from\\\":\\\"InfoSMS\\\",\\n   \\\"to\\\":\\\"41793026727\\\",\\n   \\\"text\\\":\\\"Test SMS.\\\"\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"POST /sms/1/text/single HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\\nAccept: application/xml\\n\\n<request>\\n   <from>InfoSMS</from>\\n   <to>\\n      <to>41793026727</to>\\n   </to>\\n   <text>Test SMS.</text>\\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   \\\"from\\\":\\\"InfoSMS\\\",\\n   \\\"to\\\":\\\"41793026727\\\",\\n   \\\"text\\\":\\\"Test SMS.\\\"\\n}' https://api.infobip.com/sms/1/text/single\",\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/single\\\",\\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 => \\\"{ \\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026727\\\\\\\", \\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\" }\\\",\\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/single\\\")\\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 = \\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\",\\\\\\\"to\\\\\\\":\\\\\\\"41793026727\\\\\\\",   \\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\"\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"conn = http.client.HTTPSConnection(\\\"api.infobip.com\\\")\\n\\npayload = \\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\",\\\\\\\"to\\\\\\\":\\\\\\\"41793026727\\\\\\\",\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\"\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'content-type': \\\"application/json\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"POST\\\", \\\"/sms/1/text/single\\\", 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/single\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .body(\\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\",\\\\\\\"to\\\\\\\":\\\\\\\"41793026727\\\\\\\",\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/text/single\\\");\\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\\\", \\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":\\\\\\\"41793026727\\\\\\\",\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\", ParameterType.RequestBody);\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = JSON.stringify({\\n  \\\"from\\\": \\\"InfoSMS\\\",\\n  \\\"to\\\": \\\"41793026727\\\",\\n  \\\"text\\\": \\\"Test SMS.\\\"\\n});\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = false;\\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/single\\\");\\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   \\\"messages\\\":[  \\n      {  \\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"status\\\":{  \\n            \\\"groupId\\\":0,\\n            \\\"groupName\\\":\\\"Queue/Accepted\\\",\\n            \\\"id\\\":0,\\n            \\\"name\\\":\\\"MESSAGE_ACCEPTED\\\",\\n            \\\"description\\\":\\\"Message accepted\\\"\\n         },\\n         \\\"smsCount\\\":1,\\n         \\\"messageId\\\":\\\"2250be2d4219-3af1-78856-aabe-1362af1edfd2\\\"\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<smsResponse>\\n   <messages>\\n      <message>\\n         <to>41793026727</to>\\n         <status>\\n            <id>0</id>\\n            <groupId>0</groupId>\\n            <groupName>ACCEPTED</groupName>\\n            <name>MESSAGE_ACCEPTED</name>\\n            <description>Message accepted</description>\\n         </status>\\n         <smsCount>1</smsCount>\\n         <messageId>2250be2d4219-3af1-78856-aabe-1362af1edfd2</messageId>\\n      </message>\\n   </messages>\\n</smsResponse>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n# Single textual message to multiple destinations\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /sms/1/text/single HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json  \\nAccept: application/json\\n\\n{  \\n   \\\"from\\\":\\\"InfoSMS\\\",\\n   \\\"to\\\":[  \\n      \\\"41793026727\\\",\\n      \\\"41793026834\\\"\\n   ],\\n   \\\"text\\\":\\\"Test SMS.\\\"\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"POST /sms/1/text/single HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\\nAccept: application/xml\\n\\n<request>\\n   <from>InfoSMS</from>\\n   <to>\\n      <to>41793026727</to>\\n      <to>41793026834</to>\\n   </to>\\n   <text>Test SMS.</text>\\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   \\\"from\\\":\\\"InfoSMS\\\",\\n   \\\"to\\\":[  \\n      \\\"41793026727\\\",\\n      \\\"41793026834\\\"\\n   ],\\n   \\\"text\\\":\\\"Test SMS.\\\"\\n}' https://api.infobip.com/sms/1/text/single\",\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/single\\\",\\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 => \\\"{ \\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[ \\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026834\\\\\\\" ], \\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\" }\\\",\\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/single\\\")\\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 = \\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\",\\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\",      \\\\\\\"41793026834\\\\\\\"],\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\"\\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 = \\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\",\\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\", \\\\\\\"41793026834\\\\\\\"],\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\"\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'content-type': \\\"application/json\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"POST\\\", \\\"/sms/1/text/single\\\", 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/single\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .body(\\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\",\\\\\\\"to\\\\\\\":[\\\\\\\"41793026727\\\\\\\",     \\\\\\\"41793026834\\\\\\\"],\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/text/single\\\");\\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\\\", \\\"{\\\\\\\"from\\\\\\\":\\\\\\\"InfoSMS\\\\\\\", \\\\\\\"to\\\\\\\":[  \\\\\\\"41793026727\\\\\\\",\\\\\\\"41793026834\\\\\\\"],\\\\\\\"text\\\\\\\":\\\\\\\"Test SMS.\\\\\\\"}\\\", ParameterType.RequestBody);\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = JSON.stringify({\\n  \\\"from\\\": \\\"InfoSMS\\\",\\n  \\\"to\\\": [\\n    \\\"41793026727\\\",\\n    \\\"41793026834\\\"\\n  ],\\n  \\\"text\\\": \\\"Test SMS.\\\"\\n});\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = false;\\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/single\\\");\\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\\\":\\\"f5c4322c-10e7-a41e-5528-34fa0b032134\\\",\\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\\\":\\\"4a54f0242f19-b832-1c39-a7e7a2095f351ed2\\\"\\n      },\\n      {  \\n         \\\"to\\\":\\\"41793026834\\\",\\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\\\":\\\"9404a69cef19-7a31-ba39-92ace76a5f351ed2\\\"\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<smsResponse>\\n   <bulkId>f5c4322c-10e7-a41e-5528-34fa0b032134</bulkId>\\n   <messages>\\n      <message>\\n         <to>41793026727</to>\\n         <status>\\n            <id>0</id>\\n            <groupId>0</groupId>\\n            <groupName>ACCEPTED</groupName>\\n            <name>MESSAGE_ACCEPTED</name>\\n            <description>Message accepted</description>\\n         </status>\\n         <smsCount>1</smsCount>\\n         <messageId>2250be2d4219-3af1-78856-aabe-1362af1edfd2</messageId>\\n      </message>\\n      <message>\\n         <to>41793026834</to>\\n         <status>\\n            <id>0</id>\\n            <groupId>0</groupId>\\n            <groupName>ACCEPTED</groupName>\\n            <name>MESSAGE_ACCEPTED</name>\\n            <description>Message accepted</description>\\n         </status>\\n         <smsCount>1</smsCount>\\n         <messageId>9404a69cef19-7a31-ba39-92ace76a5f351ed2</messageId>\\n      </message>\\n   </messages>\\n</smsResponse>\\n\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to send a single textual message to one destination address.","slug":"send-single-sms","type":"endpoint","title":"Single textual message"}

postSingle textual message

This method allows you to send a single textual message to one destination address.

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](#section-single-textual-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 On success, 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-single-textual-message-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#section-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", "title": "Long SMS:", "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)." } [/block] [block:api-header] { "type": "basic", "title": "Additional examples" } [/block] # Single textual message to one destination **Request** [block:code] { "codes": [ { "code": "POST /sms/1/text/single HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\n{ \n \"from\":\"InfoSMS\",\n \"to\":\"41793026727\",\n \"text\":\"Test SMS.\"\n}", "language": "json" }, { "code": "POST /sms/1/text/single HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\nAccept: application/xml\n\n<request>\n <from>InfoSMS</from>\n <to>\n <to>41793026727</to>\n </to>\n <text>Test SMS.</text>\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 \"from\":\"InfoSMS\",\n \"to\":\"41793026727\",\n \"text\":\"Test SMS.\"\n}' https://api.infobip.com/sms/1/text/single", "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/single\",\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 => \"{ \\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":\\\"41793026727\\\", \\\"text\\\":\\\"Test SMS.\\\" }\",\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/single\")\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 = \"{\\\"from\\\":\\\"InfoSMS\\\",\\\"to\\\":\\\"41793026727\\\", \\\"text\\\":\\\"Test SMS.\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "conn = http.client.HTTPSConnection(\"api.infobip.com\")\n\npayload = \"{\\\"from\\\":\\\"InfoSMS\\\",\\\"to\\\":\\\"41793026727\\\",\\\"text\\\":\\\"Test SMS.\\\"}\"\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'content-type': \"application/json\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"POST\", \"/sms/1/text/single\", 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/single\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .header(\"accept\", \"application/json\")\n .body(\"{\\\"from\\\":\\\"InfoSMS\\\",\\\"to\\\":\\\"41793026727\\\",\\\"text\\\":\\\"Test SMS.\\\"}\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/text/single\");\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\", \"{\\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":\\\"41793026727\\\",\\\"text\\\":\\\"Test SMS.\\\"}\", ParameterType.RequestBody);\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = JSON.stringify({\n \"from\": \"InfoSMS\",\n \"to\": \"41793026727\",\n \"text\": \"Test SMS.\"\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = false;\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/single\");\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 \"messages\":[ \n { \n \"to\":\"41793026727\",\n \"status\":{ \n \"groupId\":0,\n \"groupName\":\"Queue/Accepted\",\n \"id\":0,\n \"name\":\"MESSAGE_ACCEPTED\",\n \"description\":\"Message accepted\"\n },\n \"smsCount\":1,\n \"messageId\":\"2250be2d4219-3af1-78856-aabe-1362af1edfd2\"\n }\n ]\n}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<smsResponse>\n <messages>\n <message>\n <to>41793026727</to>\n <status>\n <id>0</id>\n <groupId>0</groupId>\n <groupName>ACCEPTED</groupName>\n <name>MESSAGE_ACCEPTED</name>\n <description>Message accepted</description>\n </status>\n <smsCount>1</smsCount>\n <messageId>2250be2d4219-3af1-78856-aabe-1362af1edfd2</messageId>\n </message>\n </messages>\n</smsResponse>", "language": "xml" } ] } [/block] # Single textual message to multiple destinations **Request** [block:code] { "codes": [ { "code": "POST /sms/1/text/single HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json \nAccept: application/json\n\n{ \n \"from\":\"InfoSMS\",\n \"to\":[ \n \"41793026727\",\n \"41793026834\"\n ],\n \"text\":\"Test SMS.\"\n}", "language": "json" }, { "code": "POST /sms/1/text/single HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\nAccept: application/xml\n\n<request>\n <from>InfoSMS</from>\n <to>\n <to>41793026727</to>\n <to>41793026834</to>\n </to>\n <text>Test SMS.</text>\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 \"from\":\"InfoSMS\",\n \"to\":[ \n \"41793026727\",\n \"41793026834\"\n ],\n \"text\":\"Test SMS.\"\n}' https://api.infobip.com/sms/1/text/single", "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/single\",\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 => \"{ \\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[ \\\"41793026727\\\", \\\"41793026834\\\" ], \\\"text\\\":\\\"Test SMS.\\\" }\",\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/single\")\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 = \"{\\\"from\\\":\\\"InfoSMS\\\",\\\"to\\\":[\\\"41793026727\\\", \\\"41793026834\\\"],\\\"text\\\":\\\"Test SMS.\\\"}\"\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 = \"{\\\"from\\\":\\\"InfoSMS\\\",\\\"to\\\":[\\\"41793026727\\\", \\\"41793026834\\\"],\\\"text\\\":\\\"Test SMS.\\\"}\"\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'content-type': \"application/json\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"POST\", \"/sms/1/text/single\", 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/single\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .header(\"accept\", \"application/json\")\n .body(\"{\\\"from\\\":\\\"InfoSMS\\\",\\\"to\\\":[\\\"41793026727\\\", \\\"41793026834\\\"],\\\"text\\\":\\\"Test SMS.\\\"}\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/text/single\");\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\", \"{\\\"from\\\":\\\"InfoSMS\\\", \\\"to\\\":[ \\\"41793026727\\\",\\\"41793026834\\\"],\\\"text\\\":\\\"Test SMS.\\\"}\", ParameterType.RequestBody);\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = JSON.stringify({\n \"from\": \"InfoSMS\",\n \"to\": [\n \"41793026727\",\n \"41793026834\"\n ],\n \"text\": \"Test SMS.\"\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = false;\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/single\");\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\":\"f5c4322c-10e7-a41e-5528-34fa0b032134\",\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\":\"4a54f0242f19-b832-1c39-a7e7a2095f351ed2\"\n },\n { \n \"to\":\"41793026834\",\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\":\"9404a69cef19-7a31-ba39-92ace76a5f351ed2\"\n }\n ]\n}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<smsResponse>\n <bulkId>f5c4322c-10e7-a41e-5528-34fa0b032134</bulkId>\n <messages>\n <message>\n <to>41793026727</to>\n <status>\n <id>0</id>\n <groupId>0</groupId>\n <groupName>ACCEPTED</groupName>\n <name>MESSAGE_ACCEPTED</name>\n <description>Message accepted</description>\n </status>\n <smsCount>1</smsCount>\n <messageId>2250be2d4219-3af1-78856-aabe-1362af1edfd2</messageId>\n </message>\n <message>\n <to>41793026834</to>\n <status>\n <id>0</id>\n <groupId>0</groupId>\n <groupName>ACCEPTED</groupName>\n <name>MESSAGE_ACCEPTED</name>\n <description>Message accepted</description>\n </status>\n <smsCount>1</smsCount>\n <messageId>9404a69cef19-7a31-ba39-92ace76a5f351ed2</messageId>\n </message>\n </messages>\n</smsResponse>\n", "language": "xml" } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}