First draft of UPS Package Released

Yesterday I complained about how much of a pain it was to get access to UPS's API service. Once I did get in - the docs weren't terribly helpful either. I was able to eventually find what I needed though early this morning. With that I'm happy to announce the initial release of the UPS Package (get it, UPS Package! I kill me).

Right now there are no docs and the only service I support is Address Verification. Obviously I will add to this. In order to use the code though you will need to go through the painful process I had to go through. I can say that once you do get your XML key and login info, it should work pretty easily. Here is a simple example:

<cfset av = createObject("component", "org.camden.ups.addressverification").init(application.key, application.username, application.password)>

<cfset results = av.addressVerification(city="Lafayette", state="LA",postalcode="70508")> <cfdump var="#results#">

By the way - the UPS documentation had a wonderful little gem about displaying a disclaimer in your code "from time to time". I kid you not. They want you to do it every now and then. Ahem. Well, I added a getDisclaimer() service to the CFC. Use it - um - from time to time.

You can download the zip by clicking Download below. As I said, you must have your own login and key. The avtest1.cfm file is not going to run out of the box until you set up the right application variables.

Download attached file.

Archived Comments

Comment 1 by dan posted on 12/12/2006 at 11:17 PM

Great work Ray!

Comment 2 by Sam Farmer posted on 12/12/2006 at 11:48 PM

I love the use of a disclaimer from time to time.

Maybe getDisclaimer() can have some code that randomly returns the disclaimer or not.

Heh.

Comment 3 by Sami Hoda posted on 12/13/2006 at 12:57 AM

Ray,

Have you seen this? Will you be adding package tracking next?

http://www.sacc.com/Blog/Co...

Sami

Comment 4 by Raymond Camden posted on 12/13/2006 at 1:03 AM

I had not seen it - but it is what I'm working on. My ShipmentTracking CFC has a getTrackingInfo method. It will return a struct of info about the shipment as well as a history of activity. I also allow for various filtering options based on the API.