Introducing Enhanced Destination Number Validation for SMS
- SMS API
- 07 Dec 2018
We’ve added enhanced destination number validation to the Plivo SMS API platform. Plivo can now identify invalid and non-SMS-enabled destination numbers, and also fix incorrect formats of destination numbers.
This update brings multiple benefits to our customers. Since we won’t accept messages for delivery to invalid destination numbers, we won’t charge for them either, which means cost savings straight away.
Synchronous handling for invalid numbers
SMS API requests to invalid and non-SMS-enabled numbers will be rejected with a 400 Bad Request API response, and developers can propagate the invalidation error upstream easily. To see how this works, consider a one-time password use case:
User requests OTP on an invalid destination number.
Application initiates a Send SMS API request.
Plivo returns 400 Bad Request response synchronously.
Application displays “invalid number” error to user.
Format correction for phone numbers
Plivo can also reformat incorrectly formatted phone numbers in an intelligent way. For example:
Scenario 1: A user enters the Lithuanian number 370860112345. Plivo reformats it to the E.164 international format +37060112345 before it’s forwarded to downstream carriers. Notice the missing 8 in the formatted number: 8 is only required when dialing a Lithuanian number from inside Lithuania.
Scenario 2: A user enters the Mexican number 520455512345678. Plivo reformats it to the E.164 international format +5215512345678. Notice that 045 has been replaced by 1. The prefix 045 is only to be used when dialing a domestic cell phone from a landline; 521 is the prefix for mobile phone numbers in E.164 format.
Enabling enhanced destination number validation
All new Plivo customers have enhanced destination number validation for SMS enabled by default. Existing customers can enable enhanced destination number validation from the SMS settings page of the Plivo console. We recommend all our customers enable it.