CheckPhoneNumber
Use the CheckPhoneNumber
method to validate a single phone number.
Syntax
CheckPhoneNumber(PhoneNumber, LicenseKey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
PhoneNumber |
Phone number to check. |
String
|
True | 7577698337 |
LicenseKey |
Your license key. |
String
|
True | F01d89fd-5155-5455-5585-e84ab8de8591 |
Response
Returns: PhoneReturn
object
Code Samples
// http://ws.esendex.us/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.esendex.us/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.esendex.us/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.esendex.us/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.esendex.us/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(' https://ws.esendex.us/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.esendex.us/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.esendex.us",
"Content-type: text/xml; charset=\"utf-8\"",
"SOAPAction: \"http://ws.esendex.us/PhoneVerify/query/CheckPhoneNumber\"");
$url = "http://ws.esendex.us/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(' https://ws.esendex.us/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.esendex.us/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.esendex.us
POST /phoneverify/phoneverify.asmx/CheckPhoneNumber HTTP/1.1
Host: ws.esendex.us
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.esendex.us/PhoneVerify/query">
<Company>LEVEL 3 COMMUNICATIONS. LLC - </Company>
<Valid>true</Valid>
<Use>Assigned to a code holder for normal use.</Use>
<State>VA</State>
<RC>PARKSLEY</RC>
<OCN>8825</OCN>
<OriginalNumber>(757) 544-9510</OriginalNumber>
<CleanNumber>7575449510</CleanNumber>
<SwitchName>NORFOLK</SwitchName>
<SwitchType />
<Country>United States</Country>
<CLLI>CHSKVAAYDS0</CLLI>
<PrefixType>CLEC - (Competitive Local Exchange Carrier)</PrefixType>
<LATA>252</LATA>
<sms>CLEC - (Competitive Local Exchange Carrier)</sms>
<Email />
<AssignDate>23/10/2005</AssignDate>
<TelecomCity>Chesapeake</TelecomCity>
<TelecomCounty />
<TelecomState>VA</TelecomState>
<TelecomZip>23324</TelecomZip>
<TimeZone>EST</TimeZone>
<Lat />
<Long />
<Wireless>false</Wireless>
<LRN>7576559199</LRN>
</PhoneReturn>
POST /phoneverify/phoneverify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ws.esendex.us/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.esendex.us/PhoneVerify/query">
<PhoneNumber>(757) 544-9510</PhoneNumber>
<LicenseKey>F01d89fd-5155-5455-5585-e84ab8de8591</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.esendex.us/PhoneVerify/query">
<CheckPhoneNumberResult>
<Company>LEVEL 3 COMMUNICATIONS. LLC - </Company>
<Valid>true</Valid>
<Use>Assigned to a code holder for normal use.</Use>
<State>VA</State>
<RC>PARKSLEY</RC>
<OCN>8825</OCN>
<OriginalNumber>(757) 544-9510</OriginalNumber>
<CleanNumber>7575449510</CleanNumber>
<SwitchName>NORFOLK</SwitchName>
<SwitchType />
<Country>United States</Country>
<CLLI>CHSKVAAYDS0</CLLI>
<PrefixType>CLEC - (Competitive Local Exchange Carrier)</PrefixType>
<LATA>252</LATA>
<sms>CLEC - (Competitive Local Exchange Carrier)</sms>
<Email />
<AssignDate>23/10/2005</AssignDate>
<TelecomCity>Chesapeake</TelecomCity>
<TelecomCounty />
<TelecomState>VA</TelecomState>
<TelecomZip>23324</TelecomZip>
<TimeZone>EST</TimeZone>
<Lat />
<Long />
<Wireless>false</Wireless>
<LRN>7576559199</LRN>
</CheckPhoneNumberResult>
</CheckPhoneNumberResponse>
</soap:Body>
</soap:Envelope>
POST /phoneverify/phoneverify.asmx HTTP/1.1
Host: ws.esendex.us
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.esendex.us/PhoneVerify/query">
<PhoneNumber>(757) 544-9510</PhoneNumber>
<LicenseKey>F01d89fd-5155-5455-5585-e84ab8de8591</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.esendex.us/PhoneVerify/query">
<CheckPhoneNumberResult>
<Company>LEVEL 3 COMMUNICATIONS. LLC - </Company>
<Valid>true</Valid>
<Use>Assigned to a code holder for normal use.</Use>
<State>VA</State>
<RC>PARKSLEY</RC>
<OCN>8825</OCN>
<OriginalNumber>(757) 544-9510</OriginalNumber>
<CleanNumber>7575449510</CleanNumber>
<SwitchName>NORFOLK</SwitchName>
<SwitchType />
<Country>United States</Country>
<CLLI>CHSKVAAYDS0</CLLI>
<PrefixType>CLEC - (Competitive Local Exchange Carrier)</PrefixType>
<LATA>252</LATA>
<sms>CLEC - (Competitive Local Exchange Carrier)</sms>
<Email />
<AssignDate>23/10/2005</AssignDate>
<TelecomCity>Chesapeake</TelecomCity>
<TelecomCounty />
<TelecomState>VA</TelecomState>
<TelecomZip>23324</TelecomZip>
<TimeZone>EST</TimeZone>
<Lat />
<Long />
<Wireless>false</Wireless>
<LRN>7576559199</LRN>
</CheckPhoneNumberResult>
</CheckPhoneNumberResponse>
</soap12:Body>
</soap12:Envelope>