Sidebar Menu

CheckPhoneNumber

CheckPhoneNumber is a method.

Syntax

CheckPhoneNumber(PhoneNumber, LicenseKey)

Request Parameters

Parameter Name Description Data Type Sample Input
PhoneNumber Phone number to check. String 7575449510
LicenseKey Required to authenticate users invoking this Web Service. String F01d89fd-5155-5455-5585-e84ab8de8591

Response

Returns: PhoneReturn object

Parameter Name Description Data Type Sample Input
Company Company name. String LEVEL 3 COMMUNICATIONS, LLC - VA
Valid True or false whether phone number is valid. Boolean TRUE
Use Use of phone number. String Assigned to a code holder for normal use.
State State abbreviation. String VA
RC Rate Center (geographic area used by exchange carriers to set rate boundaries for billing and for issuing phone numbers). String NRFOLKZON2
OCN Original called party. String 8825
OriginalNumber Phone number input into Web Service. String 7575449510
CleanNumber Phone number that goes into the system and comes out as cleaned version. String 7575449510
SwitchName Name of switch. String  
SwitchType Switch type. String  
Country Country phone number is from. String United States
CLLI Common language location identifier code. String NOCLLIKNOWN
PrefixType Type of company. String CLEC-(Competitive Local Exchange Carrier)
LATA Local access and transport area. String 252
SMS Type of SMS phone number uses. String CLEC-(Competitive Local Exchange Carrier)
Email Type of email SMS uses. String  
AssignDate Date phone number was issued to person. String 9/26/2005
TelcomCity City phone number belongs to. String New Brunswick
TelcomCounty County phone number belongs to. String Middlesex
TelcomState State phone number belongs to. String VA
TelcomZip ZIP Code phone number belongs to. String 8901
TimeZone Time zone phone number belongs to. String EST
Lat Latitude of telecom address. String 36.8894
Long Longitude of telecom address. String -76.2382
Wireless True or false whether phone number is wireless. Boolean FALSE
LRN Routing Number assigned to the phone number. String 7573740000

Code Samples

/* http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl was added as Web Reference and given the name WSDL */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CheckPhoneNumber.WSDL;

namespace CheckPhoneNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            WSDL.PhoneVerify PV = new WSDL.PhoneVerify();
            WSDL.PhoneReturn PR = new WSDL.PhoneReturn();

            PR = PV.CheckPhoneNumber("17575449510", "YOUR LICENSE KEY");

            Console.WriteLine("Company: " + (string.IsNullOrEmpty(PR.Company) ? "No Information Found" : PR.Company));
            Console.WriteLine("Valid: " + PR.Valid);
            Console.WriteLine("Use: " + (string.IsNullOrEmpty(PR.Use) ? "No Information Found" : PR.Use));
            Console.WriteLine("State: " + (string.IsNullOrEmpty(PR.State) ? "No Information Found" : PR.State));
            Console.WriteLine("Switch: " + (string.IsNullOrEmpty(PR.Switch) ? "No Information Found" : PR.Switch));
            Console.WriteLine("RC: " + (string.IsNullOrEmpty(PR.RC) ? "No Information Found" : PR.RC));
            Console.WriteLine("OCN: " + (string.IsNullOrEmpty(PR.OCN) ? "No Information Found" : PR.OCN));
            Console.WriteLine("Original Number: " + (string.IsNullOrEmpty(PR.OriginalNumber) ? "No Information Found" : PR.OriginalNumber));
            Console.WriteLine("Clean Number: " + (string.IsNullOrEmpty(PR.CleanNumber) ? "No Information Found" : PR.CleanNumber));
            Console.WriteLine("Switch Name: " + (string.IsNullOrEmpty(PR.SwitchName) ? "No Information Found" : PR.SwitchName));
            Console.WriteLine("Switch Type: " + (string.IsNullOrEmpty(PR.SwitchType) ? "No Information Found" : PR.SwitchType));
            Console.WriteLine("Country: " + (string.IsNullOrEmpty(PR.Country) ? "No Information Found" : PR.Country));
            Console.WriteLine("CLLI: " + (string.IsNullOrEmpty(PR.CLLI) ? "No Information Found" : PR.CLLI));
            Console.WriteLine("Prefix Type: " + (string.IsNullOrEmpty(PR.PrefixType) ? "No Information Found" : PR.PrefixType));
            Console.WriteLine("LATA: " + (string.IsNullOrEmpty(PR.LATA) ? "No Information Found" : PR.LATA));
            Console.WriteLine("SMS: " + (string.IsNullOrEmpty(PR.sms) ? "No Information Found" : PR.sms));
            Console.WriteLine("Date Assigned: " + (string.IsNullOrEmpty(PR.AssignDate) ? "No Information Found" : PR.AssignDate));
            Console.WriteLine("Telecom City: " + (string.IsNullOrEmpty(PR.TelecomCity) ? "No Information Found" : PR.TelecomCity));
            Console.WriteLine("Telecom County: " + (string.IsNullOrEmpty(PR.TelecomCounty) ? "No Information Found" : PR.TelecomCounty));
            Console.WriteLine("Telecom State: " + (string.IsNullOrEmpty(PR.TelecomState) ? "No Information Found" : PR.TelecomState));
            Console.WriteLine("Telecom Zip: " + (string.IsNullOrEmpty(PR.TelecomZip) ? "No Information Found" : PR.TelecomZip));
            Console.WriteLine("Time Zone: " + (string.IsNullOrEmpty(PR.TimeZone) ? "No Information Found" : PR.TimeZone));
            Console.WriteLine("Latitude: " + (string.IsNullOrEmpty(PR.Lat) ? "No Information Found" : PR.Lat));
            Console.WriteLine("Longitude: " + (string.IsNullOrEmpty(PR.Long) ? "No Information Found" : PR.Long));
            Console.WriteLine("Wireless: " + PR.Wireless);

            Console.ReadLine();
        }
    }
}
<cfhttp method="GET" url="http://ws.cdyne.com/phoneverify/phoneverify.asmx/CheckPhoneNumber" result="result">
  <cfhttpparam type="URL" name="PhoneNumber" value="17575449510">
  <cfhttpparam type="URL" name="LicenseKey" value="f01d89fd-5155-5455-5585-e84ab8de8591">
</cfhttp>
<cfset xmlDoc = XmlParse(#result.FileContent#)>
<cfdump var="#xmlDoc#"/>
' http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl was added as Web Reference and given the name WSDL

Imports CheckPhoneNumber.WSDL
Module Module1

    Sub Main()

        Dim PV As New PhoneVerify()
        Dim PR As New PhoneReturn()

        PR = PV.CheckPhoneNumber("17575449510", "YOUR LICENSE KEY")

        Console.WriteLine("Company: " & (If(String.IsNullOrEmpty(PR.Company), "No Information Found", PR.Company)))
        Console.WriteLine("Valid: " & PR.Valid)
        Console.WriteLine("Use: " & (If(String.IsNullOrEmpty(PR.Use), "No Information Found", PR.Use)))
        Console.WriteLine("State: " & (If(String.IsNullOrEmpty(PR.State), "No Information Found", PR.State)))
        Console.WriteLine("Switch: " & (If(String.IsNullOrEmpty(PR.Switch), "No Information Found", PR.Switch)))
        Console.WriteLine("RC: " & (If(String.IsNullOrEmpty(PR.RC), "No Information Found", PR.RC)))
        Console.WriteLine("OCN: " & (If(String.IsNullOrEmpty(PR.OCN), "No Information Found", PR.OCN)))
        Console.WriteLine("Original Number: " & (If(String.IsNullOrEmpty(PR.OriginalNumber), "No Information Found", PR.OriginalNumber)))
        Console.WriteLine("Clean Number: " & (If(String.IsNullOrEmpty(PR.CleanNumber), "No Information Found", PR.CleanNumber)))
        Console.WriteLine("Switch Name: " & (If(String.IsNullOrEmpty(PR.SwitchName), "No Information Found", PR.SwitchName)))
        Console.WriteLine("Switch Type: " & (If(String.IsNullOrEmpty(PR.SwitchType), "No Information Found", PR.SwitchType)))
        Console.WriteLine("Country: " & (If(String.IsNullOrEmpty(PR.Country), "No Information Found", PR.Country)))
        Console.WriteLine("CLLI: " & (If(String.IsNullOrEmpty(PR.CLLI), "No Information Found", PR.CLLI)))
        Console.WriteLine("Prefix Type: " & (If(String.IsNullOrEmpty(PR.PrefixType), "No Information Found", PR.PrefixType)))
        Console.WriteLine("LATA: " & (If(String.IsNullOrEmpty(PR.LATA), "No Information Found", PR.LATA)))
        Console.WriteLine("SMS: " & (If(String.IsNullOrEmpty(PR.sms), "No Information Found", PR.sms)))
        Console.WriteLine("Date Assigned: " & (If(String.IsNullOrEmpty(PR.AssignDate), "No Information Found", PR.AssignDate)))
        Console.WriteLine("Telecom City: " & (If(String.IsNullOrEmpty(PR.TelecomCity), "No Information Found", PR.TelecomCity)))
        Console.WriteLine("Telecom County: " & (If(String.IsNullOrEmpty(PR.TelecomCounty), "No Information Found", PR.TelecomCounty)))
        Console.WriteLine("Telecom State: " & (If(String.IsNullOrEmpty(PR.TelecomState), "No Information Found", PR.TelecomState)))
        Console.WriteLine("Telecom Zip: " & (If(String.IsNullOrEmpty(PR.TelecomZip), "No Information Found", PR.TelecomZip)))
        Console.WriteLine("Time Zone: " & (If(String.IsNullOrEmpty(PR.TimeZone), "No Information Found", PR.TimeZone)))
        Console.WriteLine("Latitude: " & (If(String.IsNullOrEmpty(PR.Lat), "No Information Found", PR.Lat)))
        Console.WriteLine("Longitude: " & (If(String.IsNullOrEmpty(PR.Long), "No Information Found", PR.Long)))
        Console.WriteLine("Wireless: " & PR.Wireless)

        Console.ReadLine()

    End Sub

End Module
Dim request, oXMLHttp, url
url = "http://ws.cdyne.com/phoneverify/phoneverify.asmx"

request = "<?xml version='1.0' encoding='utf-8'?>" & _
"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
"<soap:Body>" & _
"<CheckPhoneNumber xmlns=""http://ws.cdyne.com/PhoneVerify/query"">" & _
"<PhoneNumber>17575449510</PhoneNumber>" & _
"<LicenseKey>YOUR LICENSE KEY</LicenseKey>" & _
"</CheckPhoneNumber>" & _
"</soap:Body>" & _
"</soap:Envelope>"

Set oXMLHttp = CreateObject("MSXML2.ServerXMLHTTP")
oXMLHttp.open "POST", url, False
oXMLHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXMLHttp.send request
response = oXMLHttp.responseText

MsgBox oXMLHttp.responseText
<?php

// Create a new SOAP client
$client = new SoapClient('http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl');

// Specify required info to send a text message
$param = array(
  'PhoneNumber' => '17575449510',
  'LicenseKey' => 'YOUR LICENSE KEY',
);

$result = $client->CheckPhoneNumber($param);

// View the response from CDYNE
print_r($result);

?>
<?php

$xml='<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CheckPhoneNumber xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <PhoneNumber>17575449510</PhoneNumber>
      <LicenseKey> f01d89fd-5155-5455-5585-e84ab8de8591</LicenseKey>
    </CheckPhoneNumber>
  </soap:Body>
</soap:Envelope>';

$headers = array(
"POST  HTTP/1.1",
"Host: ws.cdyne.com",
"Content-type: text/xml; charset=\"utf-8\"",
"SOAPAction: \"http://ws.cdyne.com/PhoneVerify/query/CheckPhoneNumber\"");

$url = "http://ws.cdyne.com/phoneverify/phoneverify.asmx?op=CheckPhoneNumber";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$response = htmlspecialchars(curl_exec($ch));
curl_close($ch);
print_r($response);

?>
require 'net/http'
require 'URI'

puts URI.methods

url=URI.parse('http://ws.cdyne.com/phoneverify/phoneverify.asmx/CheckPhoneNumber?PhoneNumber=17575449510&LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591')

res = Net::HTTP.get_response(url)

data = res.body

puts data
gets data
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

public class CheckPhoneNumber {
    public static void main(String[] args) {
        try {
            URL url = new URL("http://ws.cdyne.com/phoneverify/phoneverify.asmx/CheckPhoneNumber?"
                              + "PhoneNumber=17575449510"
                              + "&LicenseKey=YOUR LICENSE KEY");
            try {
                InputStream in = url.openStream();
                StreamSource source = new StreamSource(in);
                printResult(source);
            } catch (java.io.IOException e) {
                e.printStackTrace();
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }

    private static void printResult(Source source) {
        try {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            StreamResult sr = new StreamResult(bos);
            Transformer trans = TransformerFactory.newInstance().newTransformer();
            Properties oprops = new Properties();
            oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
            trans.setOutputProperties(oprops);
            trans.transform(source, sr);
            System.out.println("**** Response ******");
            System.out.println(bos.toString());

            bos.close();
            System.out.println();
        } catch (Exception e) {
        }
    }
}
GET /phoneverify/phoneverify.asmx/CheckPhoneNumber?PhoneNumber=string&LicenseKey=string HTTP/1.1
Host: ws.cdyne.com
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<PhoneReturn xmlns="http://ws.cdyne.com/PhoneVerify/query">
  <Company>string</Company>
  <Valid>boolean</Valid>
  <Use>string</Use>
  <State>string</State>
  <Switch>string</Switch>
  <RC>string</RC>
  <OCN>string</OCN>
  <OriginalNumber>string</OriginalNumber>
  <CleanNumber>string</CleanNumber>
  <SwitchName>string</SwitchName>
  <SwitchType>string</SwitchType>
  <Country>string</Country>
  <CLLI>string</CLLI>
  <PrefixType>string</PrefixType>
  <LATA>string</LATA>
  <sms>string</sms>
  <Email>string</Email>
  <AssignDate>string</AssignDate>
  <TelecomCity>string</TelecomCity>
  <TelecomCounty>string</TelecomCounty>
  <TelecomState>string</TelecomState>
  <TelecomZip>string</TelecomZip>
  <TimeZone>string</TimeZone>
  <Lat>string</Lat>
  <Long>string</Long>
  <Wireless>boolean</Wireless>
  <LRN>string</LRN>
</PhoneReturn>
POST /phoneverify/phoneverify.asmx/CheckPhoneNumber HTTP/1.1
Host: ws.cdyne.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

PhoneNumber=string&LicenseKey=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<PhoneReturn xmlns="http://ws.cdyne.com/PhoneVerify/query">
  <Company>string</Company>
  <Valid>boolean</Valid>
  <Use>string</Use>
  <State>string</State>
  <Switch>string</Switch>
  <RC>string</RC>
  <OCN>string</OCN>
  <OriginalNumber>string</OriginalNumber>
  <CleanNumber>string</CleanNumber>
  <SwitchName>string</SwitchName>
  <SwitchType>string</SwitchType>
  <Country>string</Country>
  <CLLI>string</CLLI>
  <PrefixType>string</PrefixType>
  <LATA>string</LATA>
  <sms>string</sms>
  <Email>string</Email>
  <AssignDate>string</AssignDate>
  <TelecomCity>string</TelecomCity>
  <TelecomCounty>string</TelecomCounty>
  <TelecomState>string</TelecomState>
  <TelecomZip>string</TelecomZip>
  <TimeZone>string</TimeZone>
  <Lat>string</Lat>
  <Long>string</Long>
  <Wireless>boolean</Wireless>
  <LRN>string</LRN>
</PhoneReturn>
POST /phoneverify/phoneverify.asmx HTTP/1.1
Host: ws.cdyne.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ws.cdyne.com/PhoneVerify/query/CheckPhoneNumber"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CheckPhoneNumber xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <PhoneNumber>string</PhoneNumber>
      <LicenseKey>string</LicenseKey>
    </CheckPhoneNumber>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CheckPhoneNumberResponse xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <CheckPhoneNumberResult>
        <Company>string</Company>
        <Valid>boolean</Valid>
        <Use>string</Use>
        <State>string</State>
        <Switch>string</Switch>
        <RC>string</RC>
        <OCN>string</OCN>
        <OriginalNumber>string</OriginalNumber>
        <CleanNumber>string</CleanNumber>
        <SwitchName>string</SwitchName>
        <SwitchType>string</SwitchType>
        <Country>string</Country>
        <CLLI>string</CLLI>
        <PrefixType>string</PrefixType>
        <LATA>string</LATA>
        <sms>string</sms>
        <Email>string</Email>
        <AssignDate>string</AssignDate>
        <TelecomCity>string</TelecomCity>
        <TelecomCounty>string</TelecomCounty>
        <TelecomState>string</TelecomState>
        <TelecomZip>string</TelecomZip>
        <TimeZone>string</TimeZone>
        <Lat>string</Lat>
        <Long>string</Long>
        <Wireless>boolean</Wireless>
        <LRN>string</LRN>
      </CheckPhoneNumberResult>
    </CheckPhoneNumberResponse>
  </soap:Body>
</soap:Envelope>
POST /phoneverify/phoneverify.asmx HTTP/1.1
Host: ws.cdyne.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CheckPhoneNumber xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <PhoneNumber>string</PhoneNumber>
      <LicenseKey>string</LicenseKey>
    </CheckPhoneNumber>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CheckPhoneNumberResponse xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <CheckPhoneNumberResult>
        <Company>string</Company>
        <Valid>boolean</Valid>
        <Use>string</Use>
        <State>string</State>
        <Switch>string</Switch>
        <RC>string</RC>
        <OCN>string</OCN>
        <OriginalNumber>string</OriginalNumber>
        <CleanNumber>string</CleanNumber>
        <SwitchName>string</SwitchName>
        <SwitchType>string</SwitchType>
        <Country>string</Country>
        <CLLI>string</CLLI>
        <PrefixType>string</PrefixType>
        <LATA>string</LATA>
        <sms>string</sms>
        <Email>string</Email>
        <AssignDate>string</AssignDate>
        <TelecomCity>string</TelecomCity>
        <TelecomCounty>string</TelecomCounty>
        <TelecomState>string</TelecomState>
        <TelecomZip>string</TelecomZip>
        <TimeZone>string</TimeZone>
        <Lat>string</Lat>
        <Long>string</Long>
        <Wireless>boolean</Wireless>
        <LRN>string</LRN>
      </CheckPhoneNumberResult>
    </CheckPhoneNumberResponse>
  </soap12:Body>
</soap12:Envelope>