Skip to main content
Slack and Teams

Setting up the Slack app

Point your Slack app at QuantumOps: events, interactivity, the /qubit command, the older slash commands, bot permissions and direct messages.

Written By Chris Scaminaci

Last updated About 3 hours ago

Qubit and the older slash commands reach QuantumOps through your Slack app. This page lists what a Slack workspace admin changes in that app: Event Subscriptions, Interactivity, the /qubit command, the older slash commands, the bot's permissions and the App Home. Each step points at an address that QuantumOps shows you.

Before you start:

  • You need to be able to edit your Slack app. The steps assume you already have a Slack app for QuantumOps, the one that gave you the app ID, bot token and signing secret.
  • In QuantumOps you need the Administrator role to see the addresses on the Channel Assistant page, and the Administrator or Q-Director Configuration role to use the Messaging tab.
  • The Slack and Teams credentials, and the platform choice, are described in Q-Director: Slack, Teams and agent mapping.

Store the credentials first

Slack checks the events address the moment you save it, and QuantumOps answers only requests that carry a valid signature. So store the credentials before you change anything in Slack.

  1. Open Configuration β†’ Q-Director Config β†’ Messaging.
  2. Choose Slack under Select Communication Platform.
  3. Enter Slack App ID, Slack Bot Token, Slack Signing Secret and Slack Webhook URL. The bot token is the bot token that starts with xoxb-, not a user token.
  4. Select Save All Configuration.

Find your addresses

  1. Open Configuration β†’ Channel Assistant.
  2. On the Slack card, scroll to Setup reference.
  3. Note the addresses for Events, Interactivity and Slash command /qubit, and the list of Scopes.

Use the addresses exactly as shown.

Turn on Event Subscriptions

  1. In your Slack app, open Event Subscriptions and turn Enable Events on.
  2. Paste the Events address into Request URL. Slack tests it straight away.
  3. Under Subscribe to bot events, add app_mention and message.im. app_mention lets Qubit hear when someone mentions it in a channel; message.im lets it receive direct messages.
  4. Leave Subscribe to events on behalf of users empty. If message.im is listed there, Slack also sends the app the installer's private messages with other people. QuantumOps drops any direct message Qubit is not part of, but Slack should never send them at all.
  5. Save the changes.

Turn on Interactivity and add the Ask Qubit shortcut

  1. Open Interactivity & Shortcuts and turn Interactivity on.
  2. Paste the Interactivity address into Request URL. Slack uses it for the buttons on Qubit's messages (approvals, Share in conversation, the model picker and Q-Notice buttons) and for the shortcut.
  3. Under Shortcuts, select Create New Shortcut and choose On messages.
  4. Enter the name Ask Qubit and a short description, such as "Ask Qubit about this message. Only you see the answer until you share it."
  5. Enter qubit_ask_message as the Callback ID. It must match exactly, or the shortcut does nothing.
  6. Save the shortcut and the page.

People can now open the menu on any message and choose Ask Qubit. See Commands and private answers.

Add the /qubit command

  1. Open Slash Commands and select Create New Command.
  2. Enter the command /qubit.
  3. Paste the Slash command /qubit address into Request URL.
  4. Add a short description, for example "Ask Qubit anywhere". A usage hint helps people: <question> | link | model | new | routine add <schedule> :: <prompt> | routine list | status.
  5. Save.

Add the older slash commands

The agent status, summary and Q-Notice commands each need their own entry in Slack, because Slack gives every slash command a single address. They work whether or not Qubit is on. The one condition is that /qnotice also needs the person's chat account to be linked to a QuantumOps account with a role that may issue Q-Notices, and linking goes through Qubit; see Who can use the Q-Notice commands.

  1. In QuantumOps, open the Messaging tab and find Slash Commands Setup. Select Copy All Endpoints. This copies the addresses for /lunch, /brb, /online, /offline, /back, /morningsummary and /qops.
  2. In Slack, create each command with Create New Command and paste its address into Request URL.
  3. For the other older commands, use the same address as /lunch but end it with the command name: helpdesksummary, summary, sdm, monitor, unmonitor, research, clientsummary or qnotice.
  4. For /sdm, tick the option "Escape channels, users, and links sent to your app", so that a mentioned person reaches QuantumOps in a form it can read.

Once Qubit is on for Slack, /qops answers exactly like /qubit. See Agent status commands and Summary, client and Q-Notice commands.

Give the bot its permissions

  1. Open OAuth & Permissions and find Bot Token Scopes.
  2. Make sure these scopes are present:
ScopeWhat Qubit uses it for
app_mentions:readHearing mentions in channels.
chat:writePosting answers.
im:historyReading direct messages sent to Qubit.
im:writeOpening a direct message to answer or notify someone.
users:read and users:read.emailRecognising who is asking, and whether they belong to your workspace.
commandsSlash commands and the Ask Qubit shortcut.
files:readReading files that people send to Qubit.
files:writePosting files and charts that Qubit creates, and the PDF from /clientsummary.

The Scopes list in the Setup reference leaves out files:read and files:write. Add them if you want Qubit to handle files.

  1. Select Reinstall to Workspace. Slack only applies new scopes after a reinstall.
  2. Copy the Bot User OAuth Token. If it differs from the Slack Bot Token on the Messaging tab, replace it there and save.

If a file cannot be read or posted, Qubit tells the person, for example "the Slack app needs the files:write permission β€” an admin must reinstall the app".

Let people message Qubit directly

  1. Open App Home.
  2. Under Show Tabs, turn the Messages Tab on.
  3. Tick "Allow users to send Slash commands and messages from the messages tab".

Without this, Slack tells people "Sending messages to this bot has been turned off" and direct messages never reach Qubit.

Turn Qubit on and try it

  1. In QuantumOps, open Configuration β†’ Channel Assistant and tick the Slack box named "Enable the Qubit assistant in Slack". Select the Slack Save button. See Channel Assistant settings.
  2. In Slack, invite your app to a channel, then mention it with a question. You can also send it a direct message, type /qubit status, or use Ask Qubit on a message.

Until the box is ticked, Qubit answers "The Qubit assistant is not enabled for this workspace."

How QuantumOps checks Slack requests

QuantumOps checks every request from Slack against the signing secret you stored, and refuses a request with a missing, wrong or stale signature. If no signing secret is stored, or the Messaging integration is off, the older slash commands answer with a message telling you to turn Messaging on, choose Slack and store the signing secret, and they stay disabled until you do. Slack's check of the events address fails for the same reason.

When something does not work

ProblemWhat to check
Slack cannot verify the Request URLThe signing secret is missing or wrong on the Messaging tab. Save it, then try again.
A slash command says the signing secret is missingStore the signing secret and make sure the platform is saved as Slack.
Qubit says it is not enabledTick the box on the Channel Assistant page and save.
Qubit never answers a mentionThe app is not in that channel, or app_mention is not subscribed.
"Sending messages to this bot has been turned off"Turn the Messages Tab on under App Home.
File messages mention files:read or files:writeAdd the scope and reinstall the app.
Private messages between other people reach QubitRemove message.im from Subscribe to events on behalf of users.