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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Setting up for address standardization?
Pages: [1] 2

Author Topic: Setting up for address standardization?  (Read 9553 times)

Michael Mahler

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
Setting up for address standardization?
July 23, 2007, 07:34:00 pm
I was trying to setup for USPS address standardization in CiviCRM 1.7.

I am not sure if I sent the correct info or signed up at the right URL. Below is the text of the confirming email I got back from the USPS. Does this sound like I am on the right track? Should I just send them the base URL for the site?

Dear USPS Customer,

Address Information APIs are accessible with special permission.  The APIs can only be used in conjunction with USPS SHIPPING SERVICES ONLY.

We must first understand how you'll be using the API.  We need a commitment that the API will be used on a transactional basis (not batch processing or cleansing of a database, but as a customer enters the information into a form on a website).  Also, you must state that you will use the output from this API solely in association with USPS SHIPPING SERVICES ONLY.

Please provide a detailed description how you plan to use the APIs, include the URL of the site (development or production).  We will review the material received to see if you meet our requirements.

If your implementation does not meet these requirements, I suggest contacting the NCSC for other Postal products that may meet your needs.

The Address Management System Application Programming Interface (AMS API) is available on a subscription basis for $2,500/year with bi-monthly updates. For more information, write to:

AMS-API
National Customer Support Center
United States Postal Service
6060 Primacy Pkwy Ste 201
Memphis, TN  38188-0001
Email:  AMSCD.NCSC@USPS.GOV
 
Or call 877-640-0724.
 
I hope this helps,

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: Setting up for address standardization?
July 24, 2007, 01:01:18 am

welcome to the USPS bureaucracy maze :)

Yeah, looks like you are on the right track. You need to reassure them as to how and why you'll use the API's etc (for address verification etc and not batch cleaning of data) We had to go thru a similar process to get the test keys. The process might have been all online when we did it though

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

Michael Mahler

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
Re: Setting up for address standardization?
July 24, 2007, 08:57:34 am
Okay, I am unsure of how to proceed now. I just got an email from them, but it doesn't have any URL's. I do know the user ID I am using.
Quote
Thank you for requesting the U. S. Postal Service's Address Informational Application Program Interfaces (APIs).

You have been granted TEST permission to the Address Informational APIs.  With the userID provided, you will be able to run test requests and begin development.  We will then need to evaluate your application for full access to the Address Informational APIs.

When you have completed your testing, please notify the Internet Customer Care Center (ICCC) listed below.  After reviewing your application, the ICCC will update your profile to allow you access to the Production Server and provide you with the production URL.

The ICCC is manned from 7:00AM to 11:00PM Eastern Time.
        E-mail:         icustomercare@usps.com
       

For more information regarding the USPS Web Tool Kit userID policy, or for questions regarding distribution of documentation, send e-mail to icustomercare@usps.com.

Thank you for helping the U.S. Postal Service provide new Internet services to our shipping customers.




Todd
USPS Internet Customer Care Center
icustomercare@usps.com

As our customer, your privacy is important to us.  Please see our privacy policy at www.usps.com

-------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.  Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.  If you received this in error, please contact the sender and delete the material from any computer.
-------------------------------------------------------
0096

Michael Mahler

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
Re: Setting up for address standardization?
July 24, 2007, 09:03:22 am
I just checked and looked in Global Settings->Addresses.

For Address Standardization, I have

Provider: USPS

UserID: 350ERIEC2011

Web Service URL: http://testing.shippingapis.com/ShippingAPITest.dll

When I edit/update my own address, I get:

    Address not found in USPS database. Your Individual contact record has been saved.

I know that I am using a valid mailing address.

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: Setting up for address standardization?
July 24, 2007, 01:55:03 pm

Mike:

Your best bet would be to get into the code, debug and contribute back patches.

The right file is: CRM/Utils/Address/USPS.php

There is only one function in there to debug. Putting in a bunch of print and exit statements will help you (and us) figure out whats happening and why

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

Michael Mahler

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
Re: Setting up for address standardization?
July 24, 2007, 01:59:31 pm
Okay, will work on that. I haven't done too much of that sort of debugging.

The URL with the testing info looks correct, yes? Just wanted to be sure that I had a code issue and not a "stupid Mike entering invalid data into setup field" thing.

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: Setting up for address standardization?
July 24, 2007, 02:07:44 pm

Yes, seems like we do talk to the USPS server and get an error message.  you can start debugging there and see what it responds

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

twowheeler

  • I post occasionally
  • **
  • Posts: 115
  • Karma: 11
    • Harrisburg Christian Performing Arts Center
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Setting up for address standardization?
August 06, 2007, 03:47:11 am
I am getting the same "Address not found in USPS database" message here.  They sent two URLs, one is a HTTP and one is a HTTPS secure link.  Does it matter which one is used?

Michael perhaps we can debug this together, let me know if you are interested and I will send you my direct email.

FWIW however I did not get the same email from the USPS about needed to evaluate our use of their system, and the $2500 (!!!) charge.  I just signed up online and they sent me the test userID and URL.  Are we really going to be charged $2500?  Yikes, is there a decimal point missing from that number?  That would kill my interest right there.

Dan


FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Setting up for address standardization?
August 07, 2007, 05:03:01 pm
Quote from: Donald Lobo on July 24, 2007, 01:01:18 am
welcome to the USPS bureaucracy maze :)

Same bureauracy, new price.  We received a reply:
Quote
Thank you for contacting us.  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 AMS 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.

I replied:
Quote
Perhaps we didn't fill out your form correctly.  We are a non-profit (an Episcopal church) with only 240 addresses on our mailing list.  We are using an open source program that will interface with your API.  We would like to validate our members addresses to insure correct delivery and to qualify for automation rates.  May we please have access?

USPS iCustomerCare replied:
Quote
Dear USPS Customer,

What you are talking about would be database cleansing. The address api's can only be used on a transaction by transaction basis (as someone purchases something from a website, and the item is shipped USPS).

Thank you.
Lead Developer, C3 Design.
Twitter: @FatherShawn

twowheeler

  • I post occasionally
  • **
  • Posts: 115
  • Karma: 11
    • Harrisburg Christian Performing Arts Center
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Setting up for address standardization?
August 07, 2007, 05:35:26 pm
Thanks FatherShawn.  Apparently I (by sheer dumb luck) answered the questions in the registration process the "right" way, so I did not trigger any of these questions.

Civicrm does not batch process addresses via USPS to my knowledge.  If my system sends a transaction to USPS only when a new user registers for a newsletter or similar event, that is transaction by transaction, and in preparation for sending something by USPS, right? 

Perhaps we should let sleeping bureaucracies lie, before we start getting a lot of unwanted attention.

twowheeler

  • I post occasionally
  • **
  • Posts: 115
  • Karma: 11
    • Harrisburg Christian Performing Arts Center
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.1
  • PHP version: 5.3
UPDATE: it works
August 07, 2007, 06:53:25 pm
It always helps when you read the documentation.   ;)

The USPS explanation of their WebTools is here:
http://www.usps.com/webtools/_pdf/Address-Information.pdf
The test server only allows a few specific addresses to be verified.  This is why a randomly chosen real address produces an error. 

Here is how you test it -- create a new Civicrm contact as follows:
Mr Test Record  (the name can be anything since it won't be verified)
6404 Ivy Lane
Greenbelt MD
leave the zip code blank.
Save the contact record.

I get a "Contact has been saved" message and:
Mr Test Record
6406 IVY LN
GREENBELT, MD 20770-1440

With the 9-digit zip code!  So it works.  The other test record is as follows.
Ms Teresa Record
8 Wildwood Drive
Old Lyme, CT 06371

The response is:
Ms Teresa Record
8 WILDWOOD DR
OLD LYME, CT 06371-1844

Very cool.  The next step is to call them on the phone to ask for access to the production server.

Hope this helps everyone.

Dan

Update:  FYI, I am using civicrm-1.7.9379-drupal-php5 on an ubuntu edgy server.
« Last Edit: August 08, 2007, 03:01:10 pm by twowheeler »

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Setting up for address standardization?
August 08, 2007, 11:58:17 am
Doesn't work for me in CiviCRM 1.8.beta.10676.  I entered the USPS id and url into Global Settings.  I then selected "Create New Household" from the shortcuts.  Entered "Test Household" as the household name.  Then entered:

6406 Ivy Lane
Greenbelt

The lookup doesn't happen, and the following error appears in the the apache error_log

Code: [Select]
Undefined index:  address_id in /path/to/file/administrator/components/com_civicrm/civicrm/CRM/Utils/Address/USPS.php on line 84, referer: https://www.trinityhamburg.org/administrator/index2.php?option=com_civicrm&task=civicrm/contact/add&ct=Household&reset=1

The Contact is saved, no zip is added

Then if I select Edit followed by Save, the street address and city are deleted from the record and the following errors are recorded in error_log:
Code: [Select]
PHP Notice:  Undefined index:  address_id in /path/to/file/administrator/components/com_civicrm/civicrm/CRM/Utils/Address/USPS.php on line 84, referer: https://www.trinityhamburg.org/administrator/index2.php?option=com_civicrm&task=civicrm/contact/add&reset=1&action=update&cid=5

PHP Notice:  Undefined variable: location_types in /path/to/file/administrator/components/com_civicrm/civicrm/CRM/Contact/Form/Household.php on line 135, referer: https://www.trinityhamburg.org/administrator/index2.php?option=com_civicrm&task=civicrm/contact/add&reset=1&action=update&cid=5

Using Joomla 1.0.13, PHP 5.2.2
Lead Developer, C3 Design.
Twitter: @FatherShawn

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: Setting up for address standardization?
August 08, 2007, 03:29:06 pm

Can u reproduce this on our demo server and file an issue if so along with details

thanx

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

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Setting up for address standardization?
August 09, 2007, 03:21:44 am
I could not duplicate it on the Drupal demo. I temporarily loaded my USPS id into the demo, added the test household and it correctly standardized the address - but I'm using Joomla!  Would that make a difference?  If so, can someone email the backend credentials to the the Joomla demo?
« Last Edit: August 09, 2007, 03:23:36 am by FatherShawn »
Lead Developer, C3 Design.
Twitter: @FatherShawn

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Setting up for address standardization?
August 09, 2007, 09:59:18 am
Upgrading to the latest build: CiviCRM 1.8.beta.10790 seemed to fixed this issue for me.  The USPS standard test data described above standardized properly.

Now it's back, same error on line 84 of USPS.php  On Save, all address data but the state are deleted from the contact.

Further, using the SmartyDebug feature, the following variables show empty when loading a contact, but shouldn't they contain the appropriate values stored under "Global Settings"?

AddressStdProvider => empty
AddressStdUserID => empty
AddressStdURL => empty
« Last Edit: August 09, 2007, 12:54:10 pm by FatherShawn »
Lead Developer, C3 Design.
Twitter: @FatherShawn

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Setting up for address standardization?

This forum was archived on 2017-11-26.