This site is no longer updated.Go to new Conversational Cloud docs

Slack as an incoming channel


To use slack as an incoming channel:


Create and configure an application

Create an application in Slack by following the instructions.

In the future, using the application, we will get a token that will allow us to work with the slack API.

Next, in the Add features and functionality section, select the category *Bots.

Configure the application:

  1. Click the OAuth & Permissions tab.

Here, in the section Scopes, set the following parameters:

  • For Bot Token Scopes - chat:write, im:history, users.profile:read.
  • For User Token Scopes - im:history, im:read, im:write.
  1. Click on the App Home tab.

Under How Your App Displays, press Edit:

  • Enter in the Display name field the name of the bot that will be displayed for users.
  • Enter the default user name in the Default username field.
  • Move the Always Show My Bot as Online switch to the active position. Your bot will now always be displayed in online status.
  1. Click on the Outh & Permissions tab. Click Install App to Workspace to publish the application. Here, copy the tokens from the OAuth Access Token and Bot User OAuth Access Token fields.

  2. Click on the Basic Information tab. Copy the verification token from the Verification Token field.

The copied tokens will be needed to form the configuration of a channel.


Creating a channel

On the control panel click on Channels > Incoming > Create channel. In the section Messaging and social networks select Slack.

Fill in the fields:

  • Name — enter a name for the channel or leave it as default.
  • Access token — paste your access key copied from the Bot User OAuth Access Token field.
  • Verification token — paste your access key copied from the Verification Token field.
  • Application token — paste your access key copied from the OAuth Access Token field.
  • Branch — specify the branch of the project that you want to deploy in the channel, master by default.
  • Agent — select customer engagement platform or leave this field empty..
  • Deploy — select Automatic (after each saving of the changes made to the project) or Manual (using the Publish button in the line with the description of the channel).

Please note the Deploy radio button. You have to deploy a script before starting the chatbot. At this stage, the system builds the chatbot, checks script syntax and performs tests.

Click on Create. Wait for the pop-up window with the result of the deployment. If it is successful chatbot is ready for use.


Connecting the bot

Click on the icon Go to "more details" to view channel settings > Edit. You are now in the channel settings.

Copy the links:

  • to subscribe to events;
  • to subscribe to interactive events.

Event handling:

  1. In the application settings go to the Event Subscriptions tab.
  2. Move the Enable Events slider to the active position.
  3. Paste the link you copied from the Event Subscription Link field into the Request URL field.
  4. Add event handling for Bot Subscribe to Events for direct messages to the bot: message.im.
  5. Save the changes.

Handling interactive events:

  1. In the application settings, click on the Interactive Components tab.
  2. Paste the link you copied from the Interactive Event Subscription Link field into the Request URL field.
  3. Save the changes.

Testing the bot

Open the bot dialog window in Slack and send it a welcome/activation phrase provided by your script. After that, your dialogue with the bot should begin.

Learn more about working with the Slack