Apologies to the USPS--I not longer can find any error in their
examples. Likely old eyes and fat fingers on my part.
For the record, here's an example of what I have found works (formatted
for hopefully better readability):
values QSYS2.HTTP_GET('
http://production.shippingapis.com/ShippingAPI.dll'
concat '?API=Verify&XML=' concat
url_encode(
'<AddressValidateRequest USERID="126NONE03897">' concat
'<Revision>1</Revision>' concat
'<Address ID="0">' concat
'<Address1>Suite 2</Address1>' concat
'<Address2>8 Wildwood Drive</Address2>' concat
'<City>Old Lyme</City>' concat
'<State>CT</State>' concat
'<Zip5/>' concat
'<Zip4/>' concat
'</Address>' concat
'</AddressValidateRequest>')
)
;
It returns an XML string like this (again formatted for hopefully better
readability):
<?xml version="1.0" encoding="UTF-8"?>
<AddressValidateResponse>
<Address ID="0">
<Address1>STE 2</Address1>
<Address2>8 WILDWOOD DR</Address2>
<City>OLD LYME</City>
<State>CT</State>
<Zip5>06371</Zip5>
<Zip4>1844</Zip4>
<DeliveryPoint>08</DeliveryPoint>
<CarrierRoute>R010</CarrierRoute>
<Footnotes>N</Footnotes>
<DPVConfirmation>S</DPVConfirmation>
<DPVCMRA>N</DPVCMRA>
<DPVFootnotes>AACC</DPVFootnotes>
<Business>N</Business>
<CentralDeliveryPoint>N</CentralDeliveryPoint>
<Vacant>N</Vacant>
</Address>
</AddressValidateResponse>
Note that it has standardized the address and filled in the ZIP and ZIP+4.
You could also omit the city name but provided the zip and it will
figure out the city name.
Sam
On 1/5/2022 2:08 PM, Jack Woehr via MIDRANGE-L wrote:
Now I've got to figure out why some of the USPS examples, which I
copied, don't seem to work.
Um, Sam, I assume that you've, like, visited the Post Office before ... :)
As an Amazon Associate we earn from qualifying purchases.