Introduction to Webhooks

What are WebHooks?

WebHooks are essentially a way to carry out some action and pass some message via an http request to a URL. You've probably come across WebHooks if you've used services like IFTTT, Zapier or setup a Slack integration .

They are a neat and easy way to trigger a real-time response to an event and pass that information to another service to carry out some action, thereby connecting services together for a better experience.

You can read more about WebHooks here if you want to dive deeper.

How can I Use Webhooks?

Here's a couple of ways in which WebHooks can be super fun and useful to your workflow.

First up, let's see how we can find out our WebHook for our site.

Login into your Forge account. Select one of your sites, and click the Settings tab at the top of the page.

Scroll down until you find the WebHooks section...

What's in a WebHook Url?

  1. https://getforge.com/webhook is the basic url and is consistent for all webhooks. Then we need to pass some additional parameters.
  2. ?type=redeploy which specifies the type of webhook we are generating and is closely tied to the resulting action.
  3. url=mysite.getforge.io this is the url of the site you wish to redeploy. If it's a Custom domain, simply pass that instead of the getforge.io subdomain.
  4. token=YOUR_FORGE_USER_TOKEN this is your unique user token. Keep this safe and secure.

Use Cases

You can discover some interesting use cases for Webhooks on our Blog:

Incoming Webhooks - POSTMAN Example and Deploying your site with a Slack message

Outgoing Webhooks - Deployment notifications to Slack