CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • USPS address validation
Pages: [1]

Author Topic: USPS address validation  (Read 6764 times)

weretoast

  • Guest
USPS address validation
November 26, 2007, 09:02:53 am
Hi all:

I tried to set up the USPS address validation and got the following message from USPS (below).  I never got it to work, only receiving a yellow banner at the top of the page saying "Address not found in USPS database. Your Individual contact record has been saved."  Was this validation tool supposed to work on a record-by-record basis, or was it also capable of doing batch validation?

Does the message below effectively remove the functionality that had been added to CiviCRM to validate addresses?  Is there a workaround?  Here is the address we're using in the 'Web Service URL': http://testing.shippingapis.com/ShippingAPITest.dll

Any guidance will be much appreciated.  Thanks.

(message from USPS)

 Subject: Web Tools - Address APIs Request
 
 Discussion Thread
 Response (Daren H)   11/23/2007 11:50 AM
Dear HEALUtah Staff,

Thank you for contacting the USPS Internet Customer Care Center regarding Web Tools.

Thank you for contacting the USPS®. Unfortunately the Address API's can only be used in conjunction with USPS Shipping Services and is not intended for the use of cleansing databases or batch processing.

The USPS offers the Address Management System API CD as an alternative, which has all the addressing needs on it that would have been provided through the Address API. The Address Matching System Application Programming Interface is $3,500/ annually for in-house use. This allows the customer to place the data in one location on one server and develop on one platform. If the customer wishes to develop on multiple platforms or develop software for resale, there are additional charges. The customer receives an update via CD-ROM every other month. The customer may request to receive monthly CD-ROM updates for additional charges.

If you're interested in ZIP Code™ information, various ZIP Code products are available on CD-ROM on an annual subscription basis with monthly updates.

For more information, please write to the following address or call 1-800-238-3150.

National Customer Support Center
United States Postal Service
6060 Primacy Pkwy Ste 201
Memphis TN 38188-0001

Thank you for contacting United States Postal Service®.

If you have any additional questions or concerns please contact us again.

Thank you,

Daren H
USPS Internet Customer Care Center
icustomercare@usps.com

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: USPS address validation
November 26, 2007, 11:37:32 am

The two are different and we have not done any work integrating with the API CD. Basically USPS does not give folks access to the web api's if you dont answer their questions correctly (yes, its wierd !)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

weretoast

  • Guest
Re: USPS address validation
November 26, 2007, 12:10:54 pm
Lobo,

Thanks for your reply.  I went ahead and called them and then sent a follow-up email saying how we'd be using the service.  I have a feeling that they'll give us the production web service URL now.

I just want to make sure I understand how it will work . . .

As I understand it, when I save a new or edited contact record, the service will send an xml message to the web service, and the web service will respond with a message that says "yes, it is correct" or "no, it is not correct."  Or would it actually send back a standardized address to the database?

Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: USPS address validation
November 26, 2007, 02:04:55 pm

the web service will send back a standardized address which is then stored in the db. Note that the USPS module has not gotten a lot of usage, so you might end up hitting a few bugs etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: USPS address validation - 9 digit zip-codes
November 28, 2007, 03:53:11 pm
I think my question is similar.  To determine house and senate districts, we need to have 9 digit zip-codes and also for mailing 9 digit zip-codes would be helpful. There is a product called ZP4 which does this in bulk, but I was wondering if we could have an automated interface into USPS 9 digit zip-code lookup:
http://zip4.usps.com/zip4/welcome.jsp

http://www.usps.com/webtools/htm/Address-Information.htm

I received authorization for testing - but not sure how to do in php.  Tried doing as a readfile, but can't get anything to return.  Anyone have a php example?
- - - -
Actually I got it to work.  Here is my code which I found on the internet (use your own USPS ID):
Code: [Select]
$url='http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=';
$msg='
<ZipCodeLookupRequest USERID="xxxxxxxx">
<Address ID="0">
<Address1></Address1>
<Address2>6406 Ivy Lane</Address2>
<City>Greenbelt</City>
<State>MD</State>
</Address>
</ZipCodeLookupRequest>
';

//get the response from the USPS
$newurl = $url . urlencode($msg);
$contents=file_get_contents($newurl);

echo $contents;
- - - - - -
I'm not sure what do do with this now or how to ask for the zip code from within CiviCRM.

After having the zip code which we will use for mailing purposes, we can also use the zip code to access the routine on www.Vote-smart.org to lookup political information.
« Last Edit: November 28, 2007, 09:12:02 pm by Denver Dave »

MacRonin

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 14
Re: USPS address validation
November 28, 2007, 06:11:18 pm
One thing to remember about zip+4 (9 digit zipcodes) in the USA. They are based on the amount of deliverable items for a range of addresses, so they can(and sometimes though not very often do ) change over time.(I think the +4 portion increments every 50 pieces on average/day of mail) The +4 portion used to be(I haven't checked for a while) reevaluated once a quarter. If you are going to try for a postage discount(for pre-sorting) you are supposed to re-assign the +4 portion on a regular basis. The only +4 numbers that I know if that don't change are for PO Boxes(there may be other exceptions)

Now as far as electoral districts go, I have no real info. But I would assume that the zip+4 assigned to a specific district might change slightly as the +4 portion gets recalculated.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • USPS address validation

This forum was archived on 2017-11-26.