Customize Your Expert Knowledge Sharing Platform with AnswerHub

Welcome to our documentation site where you can learn how to import/export data, integrate with third party applications, and write custom AnswerHub user interfaces.

Get Started

Slack Integration

As an administrator, you can learn how to set up a slack integration with your AnswerHub community.

Overview of Slack Integration

Only an Admin/Super User can do the following:

  1. Enable/disable the slack plugin
  2. Configure the Slack Plugin with an API Key Token
  3. Set a list of pairs: "Topic - Channel" to send slack messages
  4. Set a list of pairs: "Space - Channel" "to send slack messages

1. Enable the Plugin from the Admin Dashboard

Navigate to Plugins > Manage Plugins

  • In the Disabled Plugins tab, enable the slack integration plugin by opening the drop-down and pressing the enable button.

2. Register a New Bot

To register a new bot, use the following URL:
https://<hostname>.slack.com/services/new/bot

  • Replace "hostname" with the name of your slack workspace.
  • Make sure to give the bot a name that is similar to the name of your AnswerHub site.
  • An API token will be generated when you create your new bot. Copy it for the next step.
  • To learn how to set up all of the different available features for your slack bot, read slack's documentation provided on their site.

Note:

Only certain users are allowed to add and edit integrations. Get in touch with a Workspace Owner for help with whatever it is you need to do! If you aren’t allowed to install it on your workspace, you will need to ask a Workspace Admin to approve this app

3. Enter Your API Token and Map Different Topics and Spaces

Go to /admin/integrations/slack.html in AnswerHub; enter your API token and enter the default channel for messages along with any topic mappings.

Navigation Tree Access in the Admin Dashboard: Admin Dashboard > Plugins > Slack Integration

API Key

  • paste your copied API key into the text field.

Topic to Channel List:

  • There are no limits to the number of topics that can be paired with channels.
  • Separate each new topic pairing with a comma.
    • Example Pairings: documentation=documentation, help=support, answerhub=general, default=main
    • This means that if a (question/article/idea) is posted by having topic1 (documentation) as part of the set of tags, then it will be published to the documentation channel. If that post also has topic2 (help) as part of the tags, then it will be published to the support channel too. This implies that one post would be posted in multiple channels at the same time. In case, the post doesn’t have topic1 and topic2, then it will be defaulted to be published to the main channel

Space to Channel List:

  • There are no limits to the number of spaces that can be paired with channels.
  • Spaces can only be paired with a channel name by pairing the space name with the channel name.
    • You can go to Content > Site Structure > Spaces and then hover over the spaces to see the id from the URL in the bottom left-hand corner of the dashboard.
  • Separate each new space pairing with a comma.
    • Example Pairings: Default=general, Help=support
    • This means the pair values under “Space To Channel List” will only send a slack message if there isn’t already a match on the “Topic To Channel List” setting. If there is no matching on the space id either, a message will be sent to the “default” channel, by specifying it in these settings.

TEMPLATES

  • Use the "Template Variables" at the bottom of your Slack Integration page to create message templates to be posted in the paired slack channels.

    $1 is the Question Author's name
    $2 is the Question Title
    $3 is the Question URL
    $4 is a comma-separated list of the Question Topics
    $5 is the site name
    $6 is the space name

Message Templates For Questions:

  • To receive the message in slack, make sure to check the box next to "Post message for questions?"
  • Example Template: $1 has posted a new question with the title: $2 with the topic(s): $4, in _$6_space. To view the new post, click on the following link: $3.

Message Templates for Articles:

  • To receive the message in slack, make sure to check the box next to "Post message for articles?"
  • Example Template: $1 has posted the article with the title: $2 with the topic(s) $4. To view the new post, click on the following link: $3.

Message Templates for Ideas:

  • To receive the message in slack, make sure to check the box next to "Post message for ideas?"
  • Example Template:
    $1 has suggested a new idea with the following:
    Idea title: $2 in $6 space
    Idea Topic(s): $ 4
    The site name: $5
    Idea URL: $3

4. Save Your Changes

  • Make sure to save your changes by pressing the save button.

5. Invite the Bot into Your Channel

Before you can send any messages to a channel besides #general, a user needs to invite the bot into that channel.

Changes between Slack v1 and Slack v2:

You can now include the space name in the messages templates to send to your slack channel by using the variable $6.

You can now pair your space to the channel name by using the space name instead of the space id.

Slack Integration


As an administrator, you can learn how to set up a slack integration with your AnswerHub community.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.