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:

POST /sms/1/text/single HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json

{  
   "from":"InfoSMS",
   "to":"41793026727",
   "text":"My first Infobip SMS"
}	
  

And the appropriate response is shown below:

HTTP/1.1 200 OK
Content-Type: application/json

{  
   "messages":[  
      {  
         "to":"41793026727",
         "status":{  
            "id":0,
            "groupId":0,
            "groupName":"ACCEPTED",
            "name":"MESSAGE_ACCEPTED",
            "description":"Message accepted"
         },
         "smsCount":1,
         "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2"
      }
   ]
}	
  
  • 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 or Sent messages 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

Next: Getting delivery reports for sent SMS messages.