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.
Archived Comments
Great work Ray!
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.
Ray,
Have you seen this? Will you be adding package tracking next?
http://www.sacc.com/Blog/Co...
Sami
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.