What’s the Hubbub About Webhooks?Posted by Chuck Wyatt on May 6, 2015
According to a common definition, a “webhook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST. A web application implementing webhooks will POST a message to a URL when certain things happen.
If that definition makes you want to walk the plank, let’s try to put it in plain English (and not Pirate!). In fact, let’s start with the great example of a standard interactive HubSpot web form. Now, in the not-so-old days, you could always connect a HubSpot form to a Salesforce instance, and that was super duper.
But now and then there arises the need to connect to something else – perhaps something custom. Let’s say, for example, we own some custom PHP-based legacy lead reporting application from 2008 and we’d like to just keep it updated. Or maybe instead it’s a legacy notification system of some sort. The possibilities are many and the webhook approach is there to help you out. It’s worth clarifying, though, that it’s not a solution in and of itself, it’s just a tool that can allow a 3rd party to be made a part of, for example, a form transaction.
Enter HubSpot Workflows
As we’ve mentioned webhooks are a tool—in this case a tool within HubSpot’s workflow. HubSpot workflows enable all kinds of features. We won’t go into great detail in this space, but wow, it does a lot. It’s part of HubSpot’s marketing automation system and there’s a ton of useful features that are worth exploring. Suffice it to say, among the many things you can do in HubSpot workflows, including lead nurturing, it is where you can locate the powerful action to add: “Trigger a webhook.”
The fact that webhooks are in the workflow section of HubSpot really does help explain its purpose. Think of the data that goes from your HubSpot form to your contacts queue (and perhaps Salesforce) as a “package.” Sometimes packages are wrapped in structured XML format, but our HubSpot webhooks wraps these goodies in something called JSON, which is simply another standardized approach to formatting shared data.
Let’s say our data package might originate from lead input on a form, with a final destination of your target lead queue. What the “hook” does is give you the ability to snag a copy of that valuable data package and send it to a side system elsewhere. What the “webhook” references is simply a URL endpoint for the packet’s destination. In many use cases the contents of that JSON packet will logically map to the field names and values on a HubSpot form. That package can be “unpacked” (decoded) at the point of delivery by whatever backend system or custom operation needs our data.
Key Techie Tip About Webhooks
One issue that you can depend on hearing about with regard to webhooks and intergration in general is testing. We’ll leave you with a super tech tip that is helpful for critical testing, but also if you just want to poke around and learn about webhooks. So before you even think about connecting up your form process to the back end, you can create a workflow à webhook for an endpoint test container. HubSpot references the free service RequestBin which offers the ability to create a temporary container for your special JSON package. This is highly recommended for “quick start” purposes, or for just visualizing and understanding your dataflow. It answers the question “what data is being posted?” For more advanced uses, there’s a service called “httpbin,”which even allows response testing.
Good luck and please do share any comments about your experiences with this functionality!