[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: USPS - Address Validate Request



   I did get the USPS address validation to work at a couple of clients.
   Mike, I had used your program to call HTTPAPI as a basis for the code
   (put your name in it so that's how I remember).
   The nice aspect of it was that all the addresses are standardized
   (we've all lived with "bad" address data). There were a couple of
   interesting things, tho', that I learned from it:
     * NYC (specifically Queens) addresses often have a dash in the house
       number part (e.g., 93-29 Queens Blvd), but the USPS will remove the
       dash (9329) .
     * Multi-family dwellings, such as a condo or apartment building, will
       return a default zip but the response message indicates USPS wants
       an apartment number/suite for an exact match
     * New construction addresses don't return a hit - makes sense as the
       USPS can't deliver mail there yet.

   But the response time is great, the addresses are legit. I then use the
   verified address to get Lat/Long from Google.
   So, all I can say is that it works well.
Russ Khoury
On 3/14/2014 1:08 PM, Mike Krebs wrote:

Last time I looked at the USPS license agreement, it was quite specific to valid
ation of mailing addresses used to actually mail things which, in our case, make
s it unusable as we don't mail anymore. Could we make a long line that someday w
e might mail them? Probably, but I try to live with the spirit of the agreement
not how far I could push it.

I have not looked at the UPS or Fedex license agreement but they also have addre
ss edit/validation routines.

A potentially less expensive solution than 5 digits would be [1]www.WorksWright.
com. They have a CASS certified application that standardizes addresses with som
e extensions that seem like they would get pretty close to validation.


-----Original Message-----
From: [2]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [[3]mailto:ftpapi-bounces@lists.s
cottklement.com] On Behalf Of Scott Klement
Sent: Friday, March 14, 2014 11:29 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: USPS - Address Validate Request

I tried to sign up for the USPS web service so I could test it out.

After sign up, I got back a message saying I was not authorized to the API.

I then tried to sign  up for the specific API.  I wanted more than a
week for a response, and when it came I was denied access.  They said I
wasn't allowed to use their API for what I was doing. (Despite that I
was only using it to check a single address as a test??)

On 3/14/2014 10:30 AM, Steinmetz, Paul wrote:

Chris,

Did you ever get the USPS api working?
We currently use Group1 CODE1-Plus software, for inquiry lookups and for address
 standardization.
We call Code1-Plus 'C1MATCHI' to return an address in a standardized format, fro
m 2 different databases, then we compare the results to see if equal.
we are looking for replacement options, annual maintenance is high (5-digits)

Does anyone use any address standardization and/or address inquiry software on t
he iSeries.

Thanks
Paul


-----Original Message-----
From: [4]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [[5]mailto:ftpapi-bounces@lists.s
cottklement.com] On Behalf Of Hayden, Chris
Sent: Monday, March 03, 2014 8:54 AM
To: [6]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: USPS - Address Validate Request

Can anyone help?

Using the United States Postal Service webservice called "AddressValidateRequest
" api

Called their help desk, I am in Production mode

Found this example on the internet, return code comes back '1' which means accep
ted

Can't get the five digit or four digit zip code to be returned?

Unsuccessful in having the tool fix errors, etc

According to the USPS documentation

Save time and money by reducing shipping errors due to improper address entry. T
his tool corrects errors in street addresses, including abbreviations and missin
g information. It also supplies a ZIP+4(r) Code.
View Technical Document >[7]<https://www.usps.com/business/web-tools-apis/addres
s-information-v3-1d.htm>

Test XML Request
[8]http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<Addres
sValidateRequest%20USERID="xxxxxxxxxxxx">
      <Address>
           <Address1></Address1>
           <Address2>6406 Ivy Lane</Address2>
           <City>Greenbelt</City>
           <State>MD</State>
           <Zip5></Zip5>
           <Zip4></Zip4>
      </Address>
</AddressValidateRequest>

Test XML Response
<?xml version="1.0"?>
<AddressValidateResponse>
      <Address ID="0">
           <Address2>6406 IVY LN</Address2>
           <City>GREENBELT</City>
           <State>MD</State>
           <Zip5>20770</Zip5>
           <Zip4>1440</Zip4>
      </Address>
</AddressValidateResponse>





d address1        s             38a    inz(*blanks)
d address2        s             38a    inz('6406 Ivy Lane')
d city            s             15a    inz('Greenbelt')
d state           s              2a    inz('MD')
d zip5            s              5a    inz(*blanks)
d zip4            s              4a    inz(*blanks)


//production
url = '[9]http://production.shippingapis.com/';

addressRequest =
        '<AddressValidateRequest '+
        'USERID="' + %trim(USPSUserID) + '">' +
        '<Address ID="0">'+
        '<Address1>' + %trim(Address1) +
        '</Address1>' +
        '<Address2>' + %trim(Address2) +
        '</Address2>' +
        '<City>' + %trim(City) +
        '</City>' +
        '<State>' + %trim(State) +
        '</State>' +
         '<Zip5>' + %trim(Zip5) +
         '</Zip5>' +
         '<Zip4>' + %trim(Zip4) +
         '</Zip4>' +
         '</Address></AddressValidateRequest>';

// encode the address request
Enc = http_url_encoder_new();

rc2 = http_url_encoder_addvar( Enc:
            'XML':
            %addr(addressRequest) + 2:
            %len(addressRequest));

bigString = http_url_encoder_getstr( Enc );

urlValues =
            'ShippingAPItest.dll?API=Verify&' +
             bigString;

// send request
rc = http_get_xml(url +  urlValues:
            *null: %paddr(Incoming): *null ); if rc <> 1;
   msg = http_error;
   dsply msg;
Else;

endif;



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
[10]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
[11]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
[12]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

References

   1. http://www.WorksWright.com/
   2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   5. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   6. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   7. https://www.usps.com/business/web-tools-apis/address-information-v3-1d.htm
   8. http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=
   9. http://production.shippingapis.com/
  10. http://www.scottklement.com/mailman/listinfo/ftpapi
  11. http://www.scottklement.com/mailman/listinfo/ftpapi
  12. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------