MailSERVE API: USPS CASS Certification Software/Delivery Point Validation DPV Software Service
                                      Home > Postal Software Product > CASS Integration > Sample Code


 
CASS/DPV Software: All-inclusive mail automation solution integrating your mailroom with the fastest, most economical, most reliable postal service. Interactive Component Diagram
Page Topics:
CASS Certification - CASS DPV - USPS CASS - DPV Validation
 

CASS Certification DPV Delivery Point Validation Server API

The prototype used during the USPS CASS certification DPV validation API tour relies on two simple modules shown below. USPS CASS certification and delivery point validation service is initiated by the "Go.Event". The input address is replaced with a CASS certified DPV validated solution using the "Accept.Event". If there was one and only one USPS CASS address solution, the "Go.Event" triggers the "Accept.Event" replacing the input address with the one CASS certified DPV delivery point validated solution.

Go.Event (Clicked!)
string request
long rc

// using prototype input address fields
// prepare address for CASS/DPV request
request = address_line_1.text + '~r~n' +
               address_line_2.text + '~r~n' +
               city.text + ' ' +
               state.text + ' ' +
               zipcode.text

// request CASS certification DPV validation
// API returns the number of solutions
rc = AESapigen(response.text,request)

// if zero CASS/DPV API addresses solutions
// report and return
if rc = 0 then
               response.text = 'NO ADDRESSES'
               return
end if

// if there was a CASS/DPV API service error
if rc < 0 then
               return
end if

// if there is only one CASS/DPV address
// replace the input address
if rc = 1 then
               Accept.Event(Clicked!)
end if

Accept.Event(Clicked!)
string buf
long at

// find CASS/DPV address solution
// using the selected address status
at = pos(response.text,status.text)

// isolate CASS/DPV address solution
buf = mid(response.text,at)

// drop status line
at = pos(buf,"~r~n")
buf = mid(buf,at + 2)

// find end of address line one
// replace the input address line
at = pos(buf,"~r~n")
add_line_1.text = left(buf,at - 1)
buf = mid(buf,at + 2)

// find end of address line two
// replace the input address line
at = pos(buf,"~r~n")
add_line_2.text = left(buf,at - 1)
buf = mid(buf,at + 2)

// find end of city/state/ZIP-code line
at = pos(buf,"~r~n")

// set POSTNET barcode
barcode.text = mid(buf,at + 2)
buf = left(buf,at - 1)

// replace the input ZIP-code, state-code and city
zipcode.text = right(buf,10)
buf = left(buf,len(buf) - 11)
state.text = right(buf,2)
city.text = left(buf,len(buf) - 3)


Windows USPS CASS Certification DPV Validation Integration Support

A "DLL" is provided for Windows implementations providing access to the service call AESapigen().

LAN, WAN and WEB based USPS CASS Certification/DPV Validation Server

MailSERVE provides LAN, WAN and WEB based USPS CASS certification and DPV delivery point validation service to client applications using Perl, PHP, CGI, Java, ASP.NET, C/C++, C#, VisualBasic, PowerBuilder or any programming interface supporting TCP/IP sockets. For details see USPS CASS MailSERVE features.

Contact Us
Name: Tel: E-Mail: Comment:
Home   CASS/DPV API   Features   Linux   Prototype   CASS/DPV Service   Handling Ambiguity   Providing Options   Ability to Choose   Sample Code
Do you have questions about
this page?