{"__v":27,"_id":"55153c3ac28d6125001b886d","category":{"__v":8,"_id":"54eb63b959b1172100334faf","pages":["54eb63b959b1172100334fb4","54eb63b959b1172100334fb5","54eb63b959b1172100334fb6","551539c3c859ac2f0001b46b","55153c3ac28d6125001b886d","55153e1fc859ac2f0001b470","5515424bc28d6125001b887b","55154597f854a3190036872d","551547cdbc466623002afe73","56c06e1ccfc5470d0018915d"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-23T16:10:14.298Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting started"},"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":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-27T11:17:14.887Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"After the \"Send SMS\" HTTP request was submitted to the Infobip SMS API, you will get a response containing some useful information. If everything went well, it should provide a **`200 OK`** response with message details in the response body.\n\nHere is an example of a request for sending a single SMS:\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\\\":\\\"My first Infobip SMS\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAnd the appropriate response is shown below:\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            \\\"id\\\":0,\\n            \\\"groupId\\\":0,\\n            \\\"groupName\\\":\\\"ACCEPTED\\\",\\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}\n[/block]\n - **messages** is an array of all SMS messages that were sent in the last request. In our case, it contains only one message\n - **to** is a phone number which you have sent the SMS message to\n - Each message successfully submitted to Infobip platform is uniquely identified with the **messageId**. Furthermore, the Message ID can be used for checking [Delivery status](doc:sms-delivery-reports) or [Sent messages logs](doc:message-logs)\n - **smsCount** is the number of parts the message was split into\n - **status** is the object that further describes the state of sent message. For a full list of available statuses, visit this [link](doc:response-codes)\n ----------\n\n### **Next:** [Getting delivery reports for sent SMS messages.](doc:sms-delivery-reports)","excerpt":"Handle SMS API response.","slug":"send-sms-response","type":"basic","title":"Send SMS response"}

Send SMS response

Handle SMS API response.

After the "Send SMS" HTTP request was submitted to the Infobip SMS API, you will get a response containing some useful information. If everything went well, it should provide a **`200 OK`** response with message details in the response body. Here is an example of a request for sending a single SMS: [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\":\"My first Infobip SMS\"\n}", "language": "json" } ] } [/block] And the appropriate response is shown below: [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{ \n \"messages\":[ \n { \n \"to\":\"41793026727\",\n \"status\":{ \n \"id\":0,\n \"groupId\":0,\n \"groupName\":\"ACCEPTED\",\n \"name\":\"MESSAGE_ACCEPTED\",\n \"description\":\"Message accepted\"\n },\n \"smsCount\":1,\n \"messageId\":\"2250be2d4219-3af1-78856-aabe-1362af1edfd2\"\n }\n ]\n}", "language": "json" } ] } [/block] - **messages** is an array of all SMS messages that were sent in the last request. In our case, it contains only one message - **to** is a phone number which you have sent the SMS message to - Each message successfully submitted to Infobip platform is uniquely identified with the **messageId**. Furthermore, the Message ID can be used for checking [Delivery status](doc:sms-delivery-reports) or [Sent messages logs](doc:message-logs) - **smsCount** is the number of parts the message was split into - **status** is the object that further describes the state of sent message. For a full list of available statuses, visit this [link](doc:response-codes) ---------- ### **Next:** [Getting delivery reports for sent SMS messages.](doc:sms-delivery-reports)