VerifyAddress
Use the VerifyAddress
method to verify and correct a given address. This method provides a single "best" match. Use VerifyAddressAdvanced
to get all possible matches.
Endpoint
GET (HTTP): https://pav3.cdyne.com/PavService.svc/VerifyAddress?FirmOrRecipient={FIRMORRECIPIENT}&PrimaryAddressLine={PRIMARYADDRESSLINE}&SecondaryAddressLine={SECONDARYADDRESSLINE}&Urbanization={URBANIZATION}&CityName={CITYNAME}&State={STATE}&ZipCode={ZIPCODE}&LicenseKey={LICENSEKEY}
GET (HTTPS): https://pav3.cdyne.com/PavService.svc/rest_s/VerifyAddress?FirmOrRecipient={FIRMORRECIPIENT}&PrimaryAddressLine={PRIMARYADDRESSLINE}&SecondaryAddressLine={SECONDARYADDRESSLINE}&Urbanization={URBANIZATION}&CityName={CITYNAME}&State={STATE}&ZipCode={ZIPCODE}&LicenseKey={LICENSEKEY}
Syntax
VerifyAddress(FirmOrRecipient, PrimaryAddressLine, SecondaryAddressLine, Urbanization, ZipCode, State, LicenseKey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
FirmOrRecipient |
Firm name or recipient. |
String
|
False | CDYNE Corporation |
PrimaryAddressLine |
First line of the address. |
String
|
True | 505 Independence Parkway |
SecondaryAddressLine |
Second line of the address. |
String
|
False | Suite 300 |
Urbanization |
Urbanization name (used in Puerto Rico only). |
String
|
False | |
ZipCode |
5-digit ZIP Code. |
String
|
False | 23320 |
State |
The state or 2-character state abbreviation. |
String
|
True | VA |
LicenseKey |
Your license key. |
String
|
True | F01d89fd-5155-5455-5585-e84ab8de8591 |
Response
Returns: Address
object
Code Samples
// http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VerifyAddress.WSDL;
namespace VerifyAddress
{
class Program
{
static void Main(string[] args)
{
WSDL.PavServiceClient PSC = new WSDL.PavServiceClient("pavsoap");
WSDL.Address Res = new WSDL.Address();
Res = PSC.VerifyAddress("CDYNE Corporation", "505 Independence Parkway", "Suite 300", "", "Chesapeake", "VA", "", "YOUR LICENSE KEY");
// The return section below will output the return code with the return code text along with the address information.
if (Res.ReturnCode == 100)
{
Console.WriteLine(
"Return Code: " + Res.ReturnCode + " - Input address is DPV-confirmed for all components." + "\n" +
Res.FirmNameOrRecipient + "\n" +
Res.PrimaryAddressLine + "\n" +
Res.CityName + ", " +
Res.StateAbbreviation + " " +
Res.ZipCode + "\n" +
Res.Country);
}
else
{
Console.WriteLine(
"Return Code: " + Res.ReturnCode + "\n" +
Res.FirmNameOrRecipient + "\n" +
Res.PrimaryAddressLine + "\n" +
Res.CityName + ", " +
Res.StateAbbreviation + " " +
Res.ZipCode + "\n" +
Res.Country);
}
Console.ReadLine();
}
}
}
/*
Additional Return Fields:
Res.County
Res.Urbanization
*/
<cfhttp method="GET" url="http://pav3.cdyne.com/PavService.svc/VerifyAddress" result="result">
<cfhttpparam type="URL" name="FirmOrRecipient" value="CDYNE Corporation">
<cfhttpparam type="URL" name="PrimaryAddressLine" value="505 Independence Parkway">
<cfhttpparam type="URL" name="SecondaryAddressLine" value="Suite 300">
<cfhttpparam type="URL" name="Urbanization" value="">
<cfhttpparam type="URL" name="CityName" value="Chesapeake">
<cfhttpparam type="URL" name="State" value="VA">
<cfhttpparam type="URL" name="ZipCode" value="23320">
<cfhttpparam type="URL" name="LicenseKey" value="YOUR LICENSE KEY">
</cfhttp>
<cfset xmlDoc = XmlParse(#result.FileContent#) />
<cfdump var="#xmlDoc#" />
' http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
Imports VerifyAddress.WSDL
Module Module1
Sub Main()
Dim PSC As New PavServiceClient("pavsoap")
Dim PavAdd As New Address()
PavAdd = PSC.VerifyAddress("CDYNE Corporation", "505 Independence Parkway", "Suite 300", "", "Chesapeake", "Virginia", "23320", "YOUR LICENSE KEY")
' The return section below will output the return code with the return code text along with the address information.
' To view a list of all possible return codes: https://wiki.cdyne.com/index.php/PAVv3_Return_Codes
Console.WriteLine(
"Return Code: " & PavRes.ReturnCode & vbLf &
PavRes.FirmOrRecipient & vbLf &
PavRes.PrimaryDeliveryLine & vbLf &
PavRes.CityName & ", " &
PavRes.StateAbbreviation & " " &
PavRes.ZipCode & vbLf &
PavRes.Country)
Console.ReadLine()
End Sub
End Module
' Additional Return Fields:
' PavAdd.County
' PavAdd.Urbanization
<?php
$client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
$param = array(
'FirmOrRecipient' => 'CDYNE'
, 'PrimaryAddressLine' => '505 Independence Parkway'
, 'SecondaryAddressLine' => 'Suite 300'
, 'Urbanization' => ''
, 'CityName' => 'Chesapeake'
, 'State' => 'VA'
, 'ZipCode' => '23320'
, 'LicenseKey' => 'YOUR LICENSE KEY'
);
$result = $client->VerifyAddress($param);
echo "<pre>";
print_r($result);
echo "</pre>";
?>
<?php
// Request parameters in JSON format
$param = array(
'FirmOrRecipient' => 'CDYNE'
, 'PrimaryAddressLine' => '505 Independence Parkway'
, 'SecondaryAddressLine' => 'Suite 300'
, 'Urbanization' => ''
, 'CityName' => 'Chesapeake'
, 'State' => 'VA'
, 'ZipCode' => '23320'
, 'LicenseKey' => 'f01d89fd-5155-5455-5585-e84ab8de8591'
);
$queryString = http_build_query($param);
// Method
$url = 'http://pav3.cdyne.com/PavService.svc/VerifyAddress' . '?' . $queryString;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
$response = curl_exec($ch);
curl_close($ch);
$array = json_decode($response);
print_r($array);
?>
require 'net/http'
require 'uri'
require "rexml/document"
include REXML
puts URI.methods
url = URI.parse('http://pav3.cdyne.com/PavService.svc/VerifyAddress?"
&FirmOrRecipient=CDYNE Corporation
&PrimaryAddressLine=505 Independence Parkway
&SecondaryAddressLine=Suite 300
&Urbanization=
&CityName=Chesapeake
&State=Virginia
&ZipCode=23320
&LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591')
res = Net::HTTP.get_response(url)
data = res.body
doc = Document.new(data)
doc.write(targetstr = "", 2)
puts targetstr
gets targetstr
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.Map;
import java.util.Properties;
import javax.xml.namespace.QName;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.http.HTTPBinding;
import org.w3c.dom.Document;
public final class VerifyAddress{
public static void main(String[] args) {
String LicenseKey = "(Your License Key)";
try {
URL url = new URL("http://pav3.cdyne.com/PavService.svc/VerifyAddress?FirmOrRecipient=Cdyne+Corporation&PrimaryAddressLine=2125+Smith+Ave&SecondaryAddressLine=&Urbanization=&CityName=Chesapeake&State=VA&ZipCode=23320&LicenseKey="+LicenseKey);
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) {
e.printStackTrace();
}
}
}
{
"CityName": "CHESAPEAKE",
"Country": "USA",
"County": "CHESAPEAKE CITY",
"FirmNameOrRecipient": "CDYNE CORPORATION",
"PrimaryAddressLine": "505 INDEPENDENCE PKWY STE 300",
"ReturnCode": 100,
"SecondaryAddressLine": "",
"StateAbbreviation": "VA",
"Urbanization": "",
"ZipCode": "23320-5178"
}
<Address xmlns="pav3.cdyne.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CityName>CHESAPEAKE</CityName>
<Country>USA</Country>
<County>CHESAPEAKE CITY</County>
<FirmNameOrRecipient>CDYNE CORPORATION</FirmNameOrRecipient>
<PrimaryAddressLine>505 INDEPENDENCE PKWY STE 300</PrimaryAddressLine>
<ReturnCode>100</ReturnCode>
<SecondaryAddressLine/>
<StateAbbreviation>VA</StateAbbreviation>
<Urbanization/>
<ZipCode>23320-5178</ZipCode>
</Address>