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

RE: USPS - Address Validate Request



Yes, got it to work

Can email the code if anybody wants it


Thanks,
Chris Hayden
Senior Systems Analyst
Pilot Corporation of America 
3855 Regent Blvd, Jacksonville, FL 32224
(904) 645.9999
Ext. 1252

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Steinmetz, Paul
Sent: Friday, March 14, 2014 11:30 AM
To: 'HTTPAPI and FTPAPI Projects'
Subject: RE: USPS - Address Validate Request

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, from 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 the iSeries.

Thanks
Paul


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Hayden, Chris
Sent: Monday, March 03, 2014 8:54 AM
To: 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 accepted

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. This tool corrects errors in street addresses, including abbreviations and missing information. It also supplies a ZIP+4(r) Code.
View Technical Document ><https://www.usps.com/business/web-tools-apis/address-information-v3-1d.htm>

Test XML Request
http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%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 = '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:
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
-----------------------------------------------------------------------