All Articles

WebHooks testing tools: Requestb.in and LocalTunnel

The goal of this post is to show how we can use the tools Requestb.in and LocalTunnel to make it easier the process of testing WebHooks integration.

WebHooks offer an easy and elegant way for applications and services to integrate with one another. There is a trend that we have been watching in the last years, which consists in having an interconnected set of loosely coupled cloud services, talking to each other via HTTP. The term "webhooks" was introduced by Jeff Lindsay in 2006, as a pattern in web architecture. Both services, RequestBin and LocalTunnel were created by Jeff.

Today there are a lot of cloud services which already offer WebHook integration, such as Zapier, UserVoice, ZenDesk, GitHub, etc.

The idea is quite simple. Taking the UserVoice as an example, when a new Ticket is posted on my UserVoice, I want to trigger an HTTP call to my CRM system to create a case and record the customer interaction on it. This is a typical use case of a webhook integration. 

Here is the screen of user voice where I am defining the WebHook integration

 
image

 A WebHook is just an HTTP callback sent to a URL, defined by the user in response to an event.

When I started to develop this kind of webhook integrations I felt the need to have a quick way to have real examples of the POST messages. The first Cloud service that I used to have this reals messages is Requestb.in.

RequestBin lets me create a URL that will collect requests made to it, for further inspection in a human-friendly way. With RequestBin you can look at webhook requests. Here as an example of a request made in response to a new suggestion on the UserVoice site.

image


With Requestb.in you have a quick way to inspect the HTTP request that you have to handle. But what I really like is to have a way to test the WebHook in my local machine, which means that I have to expose my web server to the world, which in some scenarios it's not easy (firewall, NATs, etc.). We can use an easy way with LocalTunnel to solve this problem. 

To use localtunnel, I need to install it in my local machine. Following the instructions on site, I rapidly noticed that I need Ruby and RubyGems, which I don't have it installed. Alternatively, and if I use version 2, I need to have Python, since the client is written in Python.

You can just skip this installation and use localtunnel for windows, which is written in C#, and available on GitHub. That's what I did.  In a further post I will show the how to use LocalTunnel on IIS Express.

Published Jan 28, 2013

Cloud Solutions and Software Engineer. Married and father of two sons. Obsessed to be a continuous learner.