Simple RAG Consumption with Slack AI Agent > Using the Simple RAG Consumption with Slack AI Agent recipe > Step 6. Create webhooks in Slack
  

Step 6. Create webhooks in Slack

Configure a Slack app that calls an API when a new message arrives.
To create a webhook in Slack, perform the following steps:
  1. 1Create a Slack App
  2. 2Enable the events API
  3. 3Subscribe to the event
  4. 4Set the required OAuth scopes
  5. 5Add bot to a channel

Create a Slack App

  1. 1Go to https://api.slack.com/apps and log in to your account.
  2. 2Click Create New App > From scratch.
  3. 3Enter the app name and select your workspace, and then click Create App as shown in the following image:
  4. The image shows the Name app & choose workspace dialog box where you can enter the app name and select your workspace.

Enable the events API

  1. 1From the navigation bar, go to Event Subscriptions.
  2. 2Turn on the toggle switch to enable events.
  3. 3In the Request URL field, enter the service URL that you get after publishing the process.
  4. Slack sends a challenge request to verify the URL as shown in the following image:
    The image shows the Event Subscriptions dialog box where you can enter the service URL after publishing the process.

Subscribe to the event

  1. 1In the Subscribe to bot events section, click Add Bot User Event and add one of the following events as required:
  2. The event allows your app to receive messages from channels it belongs to as shown in the following image:
    The image shows the Event Subscriptions page where you can add bot events.

Set the required OAuth scopes

  1. 1Go to OAuth & Permissions.
  2. 2In the Bot Token Scopes section, click Add an OAuth Scope and add one of the following OAuth scopes:
  3. 3In the Redirect URLs section, click Add New Redirect URL and add the redirect URLs in <Cloud Application Integration POD URL>/oauthcallback format and save the URLs. For example, https://na1.dm-us.informaticacloud.com/oauthcallback as shown in the following image:
  4. The image shows the redirect URLs.
  5. 4Install the app using the Install App section.

Add bot to a channel

  1. 1In Slack, go to the required channel.
  2. 2Invite the bot using /invite @<your-bot-name>.