# Rasa Slack Bot Integration

**URL:** <https://forum.rasa.com/t/rasa-slack-bot-integration/25973>\
**Category:** Rasa Open Source\
**Created:** [March 12, 2020, 8:48am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973 "2020-03-12T08:48:48Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 8:48am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/1 "2020-03-12T08:48:48Z")

</div>

Hello Everyone.

I am using rasa to connect to slack using Ngrok.

My bot is properly responding with RASA X. These are steps i have done to connect with slack.

1. Create new Channel.
2. Added new user in App home(new in slack, worked with dialogflow for me).
3. Added the URL in event subscription like this: ![slack_rasa_1](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/0087f3fb005a5a29feb95fd901cbd67aaac6aa29.jpeg)
4. subscribed to following bot events. ![slack_rasa_2](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/8/8bb30dd3dc207483b2c01d1fcaf57030f71167d2.jpeg)
5. Added localhost to redirect URL ![slack_rasa_3](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/5/589477fdcb7593a328c510255a1268ea9db93fdb.jpeg)
6. Activate Incoming webhok: ![slack_rasa_4](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/4/494d03ff1a29d31af40634347b06a2b9ca4fbe54.jpeg)
7. Installed the app to a channel
8. Copied the Bot User OAuth Access Token to my credentials file: ![slack_rasa_6](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/6/65fa4b99cc26c85e36a094050bb0023702ac2184.jpeg)
9. then started the bot using rasa run on port 5005 where ngrok is running
10. I get the response from slack into rasa (rasa run actions terminal, trying to run some google drive api ![slack_rasa_7](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/6/6f83c4548747882babc31d890d11b314101d92d5.jpeg)
11. I get following error in rasa run terminal window ![slack_rasa_8](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/5/5af611e11a6324f3938bcbecb382ce725f265971.jpeg)
12. And no message is fetched back in rasa window.

Please help its urgent

---

<div class="post-metadata">

**Author:** ![spokey](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/spokey/32/7395_2.png) [@spokey](https://forum.rasa.com/u/spokey)\
**Post date:** [March 12, 2020, 8:58am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/2 "2020-03-12T08:58:43Z")

</div>

add the channel you want to post in into the credentials file under the slack token like:

`slack_token: "token" slack_channel: "#nameofchannel" `

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 9:04am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/3 "2020-03-12T09:04:16Z")

</div>

I did that too. Still no response

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 9:06am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/4 "2020-03-12T09:06:17Z")

</div>

What command should i run in cli to start the bot. I m using rasa run.

I tried this also :

rasa run -m models --enable-api --cors “\*” --debug

The bot respose is shown in the command prompt but doesnt get fetched in the slack

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 9:18am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/5 "2020-03-12T09:18:10Z")

</div>

Here is my folder. I dont have a run.py file which i found in some of the forum responses.

My codes and window look like this:

 ![slack_rasa_9](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/1/1e3c6ab60e15162077b2f27e88bc9df721f8f03c.jpeg)

endpoints file :

 ![slack_rasa_10](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/a/afcc9f71efce24aaed60d560af7ff488eab30d9b.jpeg)

credentials file :

 ![slack_rasa_11](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/7f089ad1c2a056d7ad6258d4f8c9c44cbd93323a.jpeg)

---

<div class="post-metadata">

**Author:** ![spokey](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/spokey/32/7395_2.png) [@spokey](https://forum.rasa.com/u/spokey)\
**Post date:** [March 12, 2020, 9:52am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/6 "2020-03-12T09:52:20Z")

</div>

Maybe in OAuth&permissions Tab in Slack try to set the redirect URL to only the ngrok url like `http://fcd4e2c6.ngrok.io`

I don’t have the run.py file either. Also i havent set the action\_endpoint stuff in the endpoints.yml file. But it works for me.

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 10:29am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/7 "2020-03-12T10:29:21Z")

</div>

Still not working. I will do a fresh start

---

<div class="post-metadata">

**Author:** ![spokey](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/spokey/32/7395_2.png) [@spokey](https://forum.rasa.com/u/spokey)\
**Post date:** [March 12, 2020, 10:32am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/8 "2020-03-12T10:32:43Z")

</div>

I’m always using rasa x for starting the bot and not rasa run

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 10:33am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/9 "2020-03-12T10:33:45Z")

</div>

Okay will try that now

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 10:47am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/10 "2020-03-12T10:47:17Z")

</div>

It is not recognizing the port by rasa x i.e port 5002

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/f/fb14574b1d54c4e033eb53dba0493e56acaabb6d.png)

ngrok & rasa x response

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/8/8fc013748ba90e66da328f4c528dcfb82a7ba7e2.png)

---

<div class="post-metadata">

**Author:** ![spokey](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/spokey/32/7395_2.png) [@spokey](https://forum.rasa.com/u/spokey)\
**Post date:** [March 12, 2020, 10:49am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/11 "2020-03-12T10:49:42Z")

</div>

I’m using rasa x command and running ngrok with port 5005

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 12:37pm UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/12 "2020-03-12T12:37:46Z")

</div>

Still not responding.

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 12, 2020, 3:14pm UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/13 "2020-03-12T15:14:02Z")

</div>

@Rasa @JiteshGaikwad @Juste

Can someone help here

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 13, 2020, 11:59am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/14 "2020-03-13T11:59:08Z")

</div>

@akelad@erohmensing can some one tell me whats the issue and how should i resolve it. I have the same issue like this [Rasa bot not responding on slack](http://forum.rasa.com/t/rasa-bot-not-responding-on-slack/13704/9)

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 14, 2020, 5:37am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/15 "2020-03-14T05:37:26Z")

</div>

can some one from rasa look into the issue please. @Tobias_Wochinger @amn41

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [March 16, 2020, 8:44am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/16 "2020-03-16T08:44:26Z")

</div>

Hi @athenasaurav, can I ask why you are running Rasa X locally and not the recommended way on a server?

When it comes to running `rasa x`, although Rasa X runs on port 5002, rasa still runs on 5005, so that is the port you want to set up with ngrok.

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 16, 2020, 10:34am UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/17 "2020-03-16T10:34:23Z")

</div>

Hi… @erohmensing Thanks you very much for your reply. I m just testing it locally. And i m running rasa run and using the same port but i m not getting reply back in slack. Although rasa logs shows that rasa is receiving all the messages and correctly predicting all intents like greet and action listen further on. I will try on server also today.

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [March 16, 2020, 2:16pm UTC](https://forum.rasa.com/t/rasa-slack-bot-integration/25973/18 "2020-03-16T14:16:31Z")

</div>

To all rasa user who have this issue. Problem solved. It is issue of bot token scope and user token scope.

Following are the images of the bot token scope that i added in Oauth & Permission:

 ![Oauth__bot_token_scope_1](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/1/1fccac6eb70653b3ab429ac18cad932749c0582f.jpeg) ![Oauth__bot_token_scope_2](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/9/986a3c22fb6b296a7dd8d2ff7b05ca20019663eb.jpeg) ![Oauth__bot_token_scope_3](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/720221024aba3842e8f5c05388248daa8c902236.jpeg)

Following are the images of the user token scope that i added in Oauth & Permission:

 ![Oauth__user_token_scope_1](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/1/131d03b8d1b9740faddbc6baaac971cf50a73854.jpeg) ![Oauth__user_token_scope_2](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/9/92f0bcd2ff22dc7744f956896d4f16b9f4b5a218.jpeg)

Redirect URL :

 ![Oauth_2](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/8/8d02658f9d71b062ff8651e4d9a4be1de706ec56.jpeg)

Event Subscription :

 ![event_subscription_1](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/8/80f106b5259b425ec2a1b23acbaf6f109413fd8d.jpeg) ![event_subscription](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/7fb56ced115146a5563844d35059c91b4a3d813c.jpeg)

In `credentials.yml` file:

Enable rest Enable slack Bot User OAuth Access Token and add from Oauth Page Lastly, add

```auto
rasa:
  url: "http://localhost:5005/webhook" 

```

in end of file

click manage destribution and click on add to slack:

 ![manage_distribution](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/00dd3c3e4c523e9170272393ca26b2c5997fa444.png)

Lastly intall app. You can also set app icon and colors etc in basic information tab.

The bot user appers only after we add the scopes and it has been moved to App Home.
