Figure 7-10 Webhook Validation and Event Flow
Tools Used When Developing with Webhooks
You will face a particular difficulty when developing an
application that consumes webhooks. When using a
public service that provides webhooks, you need a
publicly accessible URL to configure the webhook
service. Typically, you develop on localhost, and the rest
of the world has no access to your application, so how do
you test your webhooks? ngrok (http://ngrok.com) is a
free tool that allows you to tunnel from a public URL to
your application running locally.
Sequence Diagrams
Now that you understand the fundamentals of REST API
(request, response, and webhooks), authentication, data
exchange, and constraints that go with rest APIs, it’s
time to introduce sequence diagrams. A sequence
diagram models the interactions between various objects
in a single use case. It illustrates how the different parts
of a system interact with each other to carry out a
function and the order in which the interactions occur
when a particular use case is executed. In simpler terms,
a sequence diagram shows how different parts of a
system work in a sequence to get something done.