Monday, June 7, 2010

Web Hooks

I've been doing a lot of API integration work lately. Mainly my days have been spent trying to master Google's Adwords, Yahoo's Search Marketing, and Microsoft's Bing. On top of that, a large chunk of my time has also been involved in Mail Chimp and Paypal's APIs. Dealing with these different APIs requires an incredible amount of reading which in turn requires a decent amount of time. The purpose in dealing with all of these APIs is to automate processes which allows for incredible scale with zero overhead (other than the guy writing the software).

I am able to trigger events that these 3rd party companies have if a change comes through our system. I am limited in having these APIs, which have no idea about each other, communicate with each other based on an event that *they* might receive. Confusing?!

An example of this could be the event of a user unsubscribing from our mail list through Mail Chimp, which handles all of our mailings. Since a user unsubscribes from Mail Chimp, I have it such that that event would trigger Mail Chimp to send me the information of that event (e.g. user's name, why they unsubscribed, date they unsubscribed, etc) to a URL that I have set up (like an event listener) that processes these 3rd party events to update our system appropriately. So in this example, when I get information on Mail Chimp's event, I might change the value of the user in our database to let us know that they are off our mailing list. These are called "web hooks".

This is great. I am now processing information based on events that are outside of my system. Now you can start using your imagination on having 3rd party events starting to interact with other 3rd party systems. Continuing with the previous example, we can take the unsubscribed user that we got information on from Mail Chimp and check our database for their action based on Adwords and then update our Adwords automatically to reflect the change in our system based on the unsubscribed user. Now I have events from one system impacting how I treat another one, all automatically.

APIs were a huge step in allowing for automation, but they can only take you so far. APIs are only half of the puzzle. Web Hooks are the other half. Now APIs can be connected together through custom HTTP Post callbacks. This idea isn't new, but I'm starting to see it gain sizable traction in the web. Hopefully developers developing new APIs will keep web hooks in mind when building.

No comments: