Peter Stuifzand

Using a webhook to GET information

This week I’m working on an application that needs to get a list of email addresses from another application. It has the following requirements.

Requirement #1: Only HTTP+URL+HTML. No SOAP, SQL or other technologies.

Requirement #2: The list can’t be cached. It needs to be updated on the moment that the information is used.

Requirement #3: Just one URL.

Requirement #4: Authentication is very important. Only programs, that are authenticated can read this information.

So, how can we create this, while keeping these requirements in mind. First I will explain what I did. Then I will show how these requirements are met.

The first program has an interface that starts a process. This process needs to have the information of the other program. So I created a place to configure an url. This url can be anything you want. The moment the first process starts, a GET request for this url is started. It parses the information on moves on to its main task.

The second program is a web application that responds on the url with a carefully selected list of information and sends it in XML format to the requester. The other thing this program does, is authenticate the request with the HTTP authentication.

Requirement #1 is the only one that I didn’t quite follow, but I’m not yet happy with how this works. It could just as easy be an HTML file.

The other requirements are all met without problems. The easiest way to authenticate the client is with HTTP authentication. This is also session-less, which is great for integrating two applications.

The only thing I will probably change is the format of the response.

© 2023 Peter Stuifzand