Using Webhooks with Slack

10 Nov.,2023

 

You can create webhooks to monitor your team's editing activity, or your customers' feedback inside of your Slack account in real time. This involves some set up on the Slack and the KnowledgeOwl side.

Previous versions of these instructions suggested you install the Incoming Webhooks app. Slack has announced deprecation of that app. Please follow the instructions below to create your own Slack app using the Incoming Webhooks functionality. (And don't worry; we have an official Slack app coming soon!)

Slack

  1. In a browser, go to https://api.slack.com/apps.
  2. Click the Create an App button.

    Create an App button

  3. In the Create an app pop-up, select the From scratch option.

    Select the "From scratch" option

  4. Give your app an App Name. Here, we use KO Webhooks.
  5. Select the Slack workspace to add the app to.
  6. Once you've finished making your selections, click the Create App button.

    Name your app and choose the workspace to create it in

  7. Optional: Your Slack App will use a default logo of a notebook and ruler when it posts through the webhook and a specific background color. To update that image or background color, you can scroll down the page to the Display Information section to update the App Icon, background color, name, and various descriptions.

    Scroll further down the page to adjust the app icon, name, description, and more!

  8. Near the top of the page in the Add features and functionality section, select Incoming Webhooks.

    Select Incoming Webhooks from the Add features and functionality section

  9. Once the Incoming Webhooks page opens, toggle the Activate Incoming Webhooks setting to On.

    Slide the Activate Incoming Webhooks toggle to "On"

  10. Scroll down to the Webhook URLs for Your Workspace section and click the Add New Webhook to Workspace button.

    Find and select this option in the Webhook URLs for Your WorkSpace

  11. This will prompt you to select a channel to post to in the app within the Slack workspace you selected in Step 5. Choose the channel you'd like the webhooks to post to and select Allow. Here, we're using the #tests channel:

    The channel options you have will depend on your Slack workspace settings; the logos displayed at the top will depend on the App Icon you selected in the Display Information and the logo for your Slack workspace

  12. This will now show a new Webhook URL in the Webhook URLs for Your Workspace section. Click the Copy button to copy it--we'll need to use it in the next set of steps!

    Copy the Webhook URL; we'll use that later!

  13. You can confirm the app was set up correctly by viewing the channel you selected; you should see a message saying that you added an integration to the channel. This notification will show as a message from you, since you're the one who set up the app.

    Sample confirmation message in your channel that the app has been added

Now you're all set to move on to the KnowledgeOwl side of the configuration!

In KnowledgeOwl

  1. Go to Your Account > Webhooks.
  2. Select the Create New Webhook button.

    Select the + Create New Webhook button near the upper left of the page

  3. This will open a pop-up where you can configure your webhook:

    The options available in the New Webhook pop-up

  4. Choose the Knowledge Bases you want to receive notifications about.
  5. Choose the Webhook Events you want to receive notifications about. See Available webhook events for more details.
  6. Select Slack from the Webhook Type dropdown.
  7. Paste the Webhook URL you copied from Slack into the Endpoint text field.
  8. Once you're done setting the webhook configuration, click the Create button.

    A sample webhook configured for our KnowledgeOwl Support knowledge base only, which will fire when New or Updated callouts are added to articles and will submit to the Slack endpoint we created as part of our Slack app in the previous section!

  9. After you create your webhook, you should see a new notification in your Slack channel (the display may vary based on the Display Information you selected):

If you received that notification, congratulations your webhook is ready to go!

Common Use Cases

Article Workflows 

You can subscribe to the article.create and article.statusChange events to receive notifications in Slack whenever someone either creates a new article, or (for example) changes an article from "Draft" to "Ready to Publish".

This can be a great way to monitor your teams writing activity, and when used in conjunction with custom author roles, it can be a powerful way to manage and approve content before it goes live.

Reader Comments

Subscribe to comment.create to receive new comments including the comment text itself, or comment.statusChange to be notified whenever someone publishes or deletes a comment.

Contact Form Submissions

Subscribe to contactForm.submit to receive notifications whenever someone submits a ticket from your knowledge base or embedded help widget.

For more information how to get slack webhook url, please get in touch with us!