A SMS API can be simply described as a well-defined software interface that enables code to send short messages via SMS Gateway.
Due to the fact that SMS communications and internet are typically divided, SMS APIs are often seen as a way to bridge a gap between the internet at large and telecom carriers. SMS APIs are used by businesses to allow web applications to easily send and receive text messages.
So what are the 5 things you should know about SMS API? Here are five key things to keep in mind.
How to make sure that an SMS has been sent
Typically, developers make sure to check that an SMS has been successfully sent to the service provider. In the event that you do receive an error code, there should be at least two different processes that your team takes.
-
When there is a temporary error, simply try to send out the SMS again.
-
If there is a fatal error, do not try to send the SMS again.
Show notifications in case of an error
If you send out an SMS API and you receive an error code for the message request, there could be a large number of reasons why it ended up failing.
No matter why, the server administrator should be notified that something unforeseen took place with the SMS API.
If you set up an internal notification system, you can be sure to troubleshoot right away to make sure that the issue does not arise again.
It is important to keep track of IP address changes
Whenever possible, it is important that you and your team get your server a static IP address. Beyond that, you could also add a list of several different IP addresses in the settings of the API to make sure that requests can be made from multiple servers.
Make sure to use correct encoding in the message body
The most regularly used character encoding across the web is UTF-8. This supports every character from all of the alphabets.
When you are testing out an API and all seems to be working just fine with the English alphabet, you may run into issues if you are trying to also reach out with messages in different languages.
If you find that this is creating trouble for you, chances are good that you are using encoding like Western or Crylic. If that is the case, all you have to do is convert the text to UTF-8 and those issues should be resolved quite quickly for you.
Make sure to use GSM-friendly characters
One single SMS can contain 160 characters. That being said, it is possible that some Unicode characters will not fit into the message that you want to send.
If the message that you are trying to send contains any characters that are not listed in the 7-bit alphabet, that message will be set to UCS-2. When that occurs, the message length will then be limited to a measly 70 characters.
This won’t only be annoying to the recipient as they receive a number of different texts to get one full message, it can also get expensive quite quickly. To avoid added costs, make sure to convert all non-GSM friendly characters to similar characters in GSM 3.38 encoding.