Skip to main content

Replying from Mattermost

Our Mattermost integration allows you to respond to messages from your customers directly from your self-hosted Mattermost instance.

caution

All the API tokens used in this guide have been revoked and are no longer valid. Please keep all your API tokens a secret!

Getting started

On the Integrations page at the left side, find Reply from Mattermost and click the "Connect" button: integrations-page-mattermost

A modal should pop up that looks like this: Mattermost authorization modal

Your Mattermost URL

First, you'll need to fill in your Mattermost URL.

Your Mattermost URL is simply the URL at which your Mattermost instance is hosted. (If you don't already have Mattermost and want to try it, the easiest way to get your own instance set up is by deploying to Heroku: https://github.com/mattermost/mattermost-server#deploy-on-heroku)

For example, the URL we use for our Mattermost demo would be: https://papercups-mattermost-demo.herokuapp.com Mattermost dashboard URL

Fill in your Mattermost URL here: papercups-ui-mattermost-url

Getting a bot token

In order to get a bot token for Makassan, you may need to first enable bot accounts in your settings.

Enabling bot accounts

To enable bot accounts, you'll need to navigate to Menu > System Console > Integrations > Bot Accounts.

First, open the menu and navigate to the System Console: Mattermost menu System Console

Then, navigate to the Bot Accounts subsection under the Integrations section. System Console Bot Accounts

Set Enable Bot Account Creation to true and hit the Save button at the bottom.

Creating a bot account

Next, set up your bot account by navigating to Menu > Integrations > Bot Accounts > Add Bot Account.

First, open the menu and navigate to the Integrations: menu-integrations

On the Integrations page, navigate to Bot Accounts: mattermost-integrations-bot-accounts

Click the "Add Bot Account" button: mattermost-add-bot-account-page

Then, enter the following information in the Add Bot Account form: mattermost-add-bot-account

Bot account details:

  • Username: papercups (name this whatever you want)
  • Display Name: Papercups (name this whatever you want)
  • Role: System Admin (important!)

Click "Create Bot Account". That should lead you to this page: bot-account-success

Take note of the Token. This is the bot token which you should paste into Makassan: papercups-ui-bot-token

Select a channel to reply from

If your bot token is working properly, you should now be able to select the channel from which you would like to reply to messages from Makassan.

Select Mattermost channel

As a best practice, it's good to set up a channel dedicated to responding to messages and nothing else.

Setting up an outgoing webhook

In order to reply to messages directly from Mattermost, you'll need to set up an outgoing webhook.

To do this, navigate to Menu > Integrations > Outgoing Webhooks > Add Outgoing Webhook

Once again, open the menu and navigate to the Integrations: menu-integrations

On the Integrations page, navigate to Outgoing Webhooks: Integrations page outgoing webhooks

If you don't see this option, you may need to enable outgoing webhooks.

Click the "Add Outgoing Webhook" button: mattermost-outgoing-webhooks-page

Then, enter the following information in the form: mattermost-add-outgoing-webhook

Outgoing webhook details:

  • Title: Makassan
  • Description: Webhook events for the Makassan integration
  • Content Type: application/json (important!)
  • Channel: Should match the channel you chose above (important!)
  • Callback URLs: https://s1.makassan.com/api/mattermost/webhook or REPLACE WITH YOUR SELF-HOSTED URL (important!)

Click Save. After creating the new outgoing webhook, take note of the Token. mattermost-webhook-success

Finally, copy the token into the Makassan UI: papercups-ui-webhook-token

Enabling outgoing webhooks

If you don't see an option for outgoing webhooks, you may need to enable it.

You can do this by navigating to Menu > System Console > Integrations > Integrations Management and setting Enable Outgoing Webhooks set to true.

Testing the integration

From here, you can test sending messages through the chat widget to verify that they show up in your Mattermost channel.

In order to reply from Mattermost, simply reply to the message in a thread.