Validating international phone numbers
Previously entered numbers will remain as they are unless edited, at which point they will require validation.
Please note that validation is performed on the format of the number. In certain cases the system may still create phone numbers that will not be set as a direct-line.
It can even deduce a country from a provided IP as country input.
While providing a country verifies that a number belongs to a region, it is not required assuming a phone number is a valid numbering scheme and includes the country code.
It also enables you to work with the other APIs, such as the Pricing API.
This means that as well as validating and sanitizing a phone number, you can confirm the cost of sending text messages and voice calls to it, as we demonstrate in the calculate the cost section of this tutorial.
For example, a user created with the User API may contain a phone number comprised of any text string.Working with international clients adds new challenges, requiring your phone number lists to be properly formatted for routing within a country, as well as internationally.Working domestically also presents its own challenges through maintaining FCC compliance in marketing efforts to mobile users.You learn how to sanitize and validate phone numbers using the Nexmo REST API client for Ruby.
The tutorial project is not an application, but a collection of code snippets that show you how to work with the Number Insight API.
One of its most useful features is that it tells you This output shows that the number is a landline and therefore best suited to voice calls, which you can make at a cost of 0.12 EUR per minute.