Phone Verify API

Quick Start: Ruby

There are three steps to integrating the Phone Verify API into your Ruby project.

1. Create an account.

Sign up for an Esendex account. When you register you will receive a license key. You will need this to use the API.

2. Install Ruby.

Install Ruby if it is not on your computer already. To check, run this command in your terminal: ruby --version

PS C:\> ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]

3. Verify a phone number.

Install Savon, a SOAP client for Ruby. Run this command in your terminal: gem install savon

Create a new Ruby file. Let’s call it demo.rb.

You can use the CheckPhoneNumber method to verify a phone number. Add the displayed code to your new file.

Replace the LicenseKey value with your account’s license key.

require 'pp'
require 'savon'

client = Savon.client(wsdl: '')
phone_number = '17575449510'
license_key = '00000000-0000-0000-0000-000000000000'

response =
  message: {
    'PhoneNumber' => phone_number,
    'LicenseKey' => license_key

pp response.body

Run the project in your terminal with this command: ruby demo.rb. The program will display the results of the phone number verification.

PS C:\RubyDemo> ruby demo.rb
    {:company=>"LEVEL 3 COMMUNICATIONS, LLC - ",
     :use=>"Assigned to a code holder for normal use.",
     :country=>"United States",
     :prefix_type=>"CLEC - (Competitive Local Exchange Carrier)",
     :sms=>"CLEC - (Competitive Local Exchange Carrier)",

Let’s start sending, together.