GetZipCodesForFips
The GetZipCodesForFips
method returns all ZIP Codes within a given FIPS (Federal Information Processing Standard) code.
Endpoint
GET (HTTP): https://pav3.cdyne.com/PavService.svc/GetZipCodesForFips?Fips={FIPS}&LicenseKey={LICENSEKEY}
GET (HTTPS): https://pav3.cdyne.com/PavService.svc/rest_s/GetZipCodesForFips?Fips={FIPS}&LicenseKey={LICENSEKEY}
Syntax
GetZipCodesForFips(Fips, LicenseKey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
Fips |
FIPS code that represents the area or county of interest. |
String
|
True | 51550 |
LicenseKey |
Your license key. |
String
|
True | F01d89fd-5155-5455-5585-e84ab8de8591 |
Response
Returns: ZipCodesResponse
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 GetZipCodesForFips.WSDL;
namespace GetZipCodesForFips
{
class Program
{
static void Main(string[] args)
{
WSDL.PavServiceClient PSC = new PavServiceClient("pavsoap");
WSDL.ZipCodesResponse ZCR = new ZipCodesResponse();
ZCR = PSC.GetZipCodesForFips("51550", "YOUR LICENSE KEY");
if (ZCR.ReturnCode == 0)
{
Console.WriteLine("ZIP Codes(s) Found: " + "\n");
foreach (string Zip in ZCR.ZipCodes)
{
Console.WriteLine(Zip);
}
}
else if (ZCR.ReturnCode == 1)
Console.WriteLine("Invalid input.");
else if (ZCR.ReturnCode == 2)
Console.WriteLine("Invalid license key.");
else if (ZCR.ReturnCode == 3)
Console.WriteLine("No zip codes found.");
Console.ReadLine();
}
}
}
<cfhttp method="GET" url="http://pav3.cdyne.com/PavService.svc/GetZipCodesForFips" result="result">
<cfhttpparam type="URL" name="Fips" value="51550">
<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 GetZipCodesForFips.WSDL
Module Module1
Sub Main()
Dim PSC As New PavServiceClient("pavsoap")
Dim ZCR As New ZipCodesResponse
ZCR = PSC.GetZipCodesForFips("51550", "YOUR LICENSE KEY")
If ZCR.ReturnCode = 0 Then
Console.WriteLine("ZIP Code(s) found: " & vbLf)
For Each Zip As String In ZCR.ZipCodes
Console.WriteLine(Zip)
Next
ElseIf ZCR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
ElseIf ZCR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
ElseIf ZCR.ReturnCode = 3 Then
Console.WriteLine("No zip codes found.")
End If
Console.ReadLine()
End Sub
End Module
<?php
$client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
$param = array(
'Fips' => '51550'
, 'LicenseKey' => 'YOUR LICENSE KEY'
);
$result = $client->GetZipCodesForFips($param);
echo "<pre>";
print_r($result);
echo "</pre>";
?>
{
"ReturnCode": 0,
"ZipCodes": [
"23320",
"23321",
"23322",
"23323",
"23324",
"23325",
"23326",
"23327",
"23328"
]
}
<ZipCodesResponse xmlns="pav3.cdyne.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>0</ReturnCode>
<ZipCodes xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a:string>23320</a:string>
<a:string>23321</a:string>
<a:string>23322</a:string>
<a:string>23323</a:string>
<a:string>23324</a:string>
<a:string>23325</a:string>
<a:string>23326</a:string>
<a:string>23327</a:string>
<a:string>23328</a:string>
</ZipCodes>
</ZipCodesResponse>