4 ms·
I've setup a few webhooks over the past few years, and one of the complications that people rarely talk about is the data that is passed to various webhooks. A
by stevekemp 9y ago
I've setup a few webhooks over the past few years, and one of the complications that people rarely talk about is the data that is passed to various webhooks.
As the article alludes to APIs change over time, and so you can find the data that is submitted to you changes. In my case I setup an end-point that responded to push events from various code-hosting services.
I found that the three "main" git-hosts sent widely different data in their webhooks, and updates we often painful. (Github, bitbucket, and .. something else. I forget now.) Trying to have one end-point to handle all services was a recipe for frustration and failures. Even parsing out the basic details was hard:
* This is the SSH repository URL of the thing that was committed to
In the end I moved to self-hosting git-repositories, rather than allowing users to point at my webhook. That allowed hooks in the master-repos to fire.
(In my case I trigger DNS updates when git commits are made.)
- marten-de-vries 9y agoAs using webhooks for git repositories is probably the most common usage, it would be really nice if the different APIs converged here. Now everyone is inventing their own (and I'm in fact guilty to this myself for a side-project).