Send SMS: Introduction

Send your first SMS using Infobip API!

In a few simple steps, we will explain how to send an SMS using Infobip HTTP API. 

First, you’ll need a valid Infobip account

Next, your username and password have to be encoded in base64 like this:

 - Combine the username and password into a string username:password.  - Encode the resulting string using a Base64 encoder.

Example:

Username: Aladdin Password: openSesame

String: Aladdin:openSesame Base64 encoded string: QWxhZGRpbjpvcGVuU2VzYW1l

The message will be sent only to a valid phone number (numbers), written in international format e.g. 41793026727.

Phone numbers format

We strongly recommend using the E.164 number formatting. E.164 numbers are internationally standardized to a fifteen digit maximum length. Phone numbers are usually prefixed with + (plus sign), followed by a country code, network code and the subscriber number. Phone numbers that are not E.164 formatted may work, depending on the handset or network.

Now, you are ready to create an HTTP POST request to https://api.infobip.com/sms/1/text/single

Your Header should contain authorization and content type:

  • Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
  • Content-Type: application/json

Request body contains the message you wish to send with from, to and text parameters.

Full JSON request is shown below:

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"
}	
  

That's it! You should receive an SMS in a few moments.

Important:

To protect end users from receiving duplicated or repeated information over a short period of time, our platform has a flooding filter enabled by default with predefined thresholds counteracting possible programming and service errors. If your application has legitimate reasons, during a testing period for instance, for submitting a substantial amount of messages towards distinct subscribers, please get in touch with our support team at support@infobip.com to discuss a suitable solution.

For more information about sending SMS messages using Infobip SMS API, plus a full list of available features, visit the Documentation page.