Converse AI

It is possible to integrate Converse.AI with a Slack app that can easily be published or shared with the end users only requiring the 'Add to Slack' button to integrate the app with their team.

We support integration with Slack in two ways but they share the same basic setup

Setup

Create a new app on Slack or manage an existing one.

You will need the Client ID and Client Secret to link your Slack app with the Converse Slack channel.

You may also add the verification token for additional security, which is highly recommended. The verification token field in Slack may not appear until you have added the Request URL to either Interactive Messages or Event Subscriptions so you should leave this blank in Converse until you have the valid value from Slack or the calls may fail including the initial call made by Slack to validate the request URL for interactive messages and events.

The Bot Type selection is determined by the differences detailed below but can be changed before you start conversing with the bot without causing any additional difficulties later on. Changing the Bot Type will regenerate the 'Add to Slack' button HTML.

Group Channel Users checkbox is used if you want all users conversing in a single channel to be treated as a single user by the bot. This means that any user can continue a conversation stared by another and does mean that the normal behaviour of being able to determine a users name is not available. This does not affect the behaviour of a user conversing with a bot user inside the DM channel to the bot user.

When saving the channel registration details it will generate a Redirect URL, Request URL, and the 'Add to Slack' button HTML that can be shared for anyone to add your Slack app.

The Redirect URL is required for the OAuth process and should be added in your Slack app settings under 'OAuth & Permissions'

The Request URL is required for events, so we know when the bot has been spoken to, and interactive messages, so we know if a button in a Slack message has been pressed.
You add the Request URL to your Slack app under 'Interactive Messages' and 'Event Subscriptions'. The events you need to subscribe too are defined by your choice of bot integration type detailed below.

Bot User integration

This allows you to add a Slack bot user to any team that will be able to integrate with users either through direct messages or on any channel the bot user has been added to.

To use the bot user integration type, you would select the Bot Type value 'User' when registering your application with Converse.

Your Slack app will require the following settings to be properly integrated.

  • Under 'Bot User' you must create a bot user
  • Under 'Event Subscriptions' you must add the 'Bot Events'
    • 'message.channels', which listens for messages posted to a channel
    • 'message.im', which listens for messages posted as a direct message

Channel Bot integration

This allows you to interact with the Slack app within a specific channel, which is selected by the user that authenticated the app.

To use the channel bot integration type, you would select the Bot Type value 'Channel' when registering your application with Converse.

Your Slack app will require the following settings to be properly integrated.

  • Under 'Event Subscriptions' you must add the 'Team Events'
    • 'message.channels', which listens for messages posted to the channel

Scopes

The 'Add to Slack' button HTML we generate will include all the scopes that we need to properly use the Slack integration so you do not need to be concerned about what is needed for the button to work properly, just select your bot type and save the settings and the HTML will be generated for you.

If you define additional scopes for another aspect of your app or want to request access without using the button you will need to include the following scopes for the Converse integration to function correctly

  • bot (Only for bot user integration)
  • incoming-webhook (Only for channel bot integration)
  • channels:history (Only for channel bot integration)
  • chat:write:bot (Only for channel bot integration)

Additional Permissions

It is possible to add additional scopes that expand the capability of Converse. Adding the additional permissions will add the new scopes to the generated 'Add to Slack' button.

  • User Profile, adds the 'users:read' scope - This grants the ability to get the users profile information.
  • User Email, adds the 'users:read.email' scope - This grants the ability to get the users email address. This will also automatically grant the 'users:read' permission.
  • Channel information, adds the 'channels:read' scope - This grants the ability to get the channel information that is being used.
  • Slash commands, adds the 'commands' scope - This grants the ability to add slash commands from your Slack app to the authenticated team.

Slash Commands

It is possible to add slash commands to Slack teams from your app that invoke actions in Converse. Please check the Slash Commands page for more details.

Modules

Create Attachment

Create an attachment that will be displayed during the Slack conversation either as a question, comment, or an answer instead of the states default value.

Slack