Connect Slack
Connect a Slack app to Servicely through a Slack messaging account so people can talk to Servicely AI agents in Slack.
Connect Slack when people in your Slack workspace should reach Servicely AI agents from direct messages, group messages and channel threads. This task is for administrators of both Servicely and the Slack workspace.
Before you begin
- You need the
administratorrole in Servicely. - The Slack Integration application (
integration_slack) is installed. It adds an inactive messaging account named “Slack” and an API outbound token named “Slack bot token” of type Bearer. See Applications. - You can create and install apps in the Slack workspace.
Steps
-
In Slack, create an app for your workspace. Copy its signing secret and its bot token[UNVERIFIED].
-
In Servicely, open the API outbound token “Slack bot token”. Keep Type as Bearer, enter the Slack bot token[UNVERIFIED] and save.
-
Go to Administration → Messaging → Messaging accounts and open “Slack”. Check that Provider is Slack.
-
Paste the Slack signing secret into App secret. Select “Slack bot token” in Outbound API token. Set Active to Yes and save. Note the record’s ID.
-
Build the three Servicely endpoints from your instance address, the path
/_messaging/v3/slack/and the record ID. The table below lists them. -
In the Slack app, enter the events endpoint as the event subscription request URL[UNVERIFIED]. Servicely answers Slack’s verification challenge automatically.
-
Enter the interactivity endpoint as the app’s interactivity request URL[UNVERIFIED]. Without it, buttons such as “Close this conversation” appear in Slack but do nothing.
-
Optionally, create the slash commands
/newchat,/clearand/endchatwith the commands endpoint as their request URL. -
Install the app to the workspace, then send the app a direct message to test the connection.
| Endpoint | Path after the instance address | Receives |
|---|---|---|
| Events | /_messaging/v3/slack/ followed by the record ID |
Messages from direct messages, group messages and channels |
| Interactivity | The events path followed by /interactivity |
Button presses |
| Commands | The events path followed by /commands |
Slash commands |
Result
Messages to the Slack app reach Servicely, and replies come back in the same direct message, group message or channel thread. Typing /newchat closes the current conversation. Outbound notifications can also use the Slack provider type.