Slack
How to publish a bot on Slack
Get Redirect and Request URLs
- Log in to the Gupshup website.
- Go to Dashboard tab > My Bots section.
- Select the button under the Publish column against the bot you wish to publish.
- A list of channels will appear. Click on the Publish button against Slack.
- Scroll down and click Set the 'Redirect URLs'. Copy the Redirect URL given there to submit on Slack later.
![Slack 5.png 1034](https://files.readme.io/4220e1e-Slack_5.png)
- Scroll down and click Enabling events'. Copy the Request URL given there to submit on Slack.
![Slack 7.png 1206](https://files.readme.io/a1ca7a6-Slack_7.png)
- Scroll down and click Enable Interactive Components'. Copy the Request URL given there to submit on Slack.
![Slack 8.png 1244](https://files.readme.io/ce0ce38-Slack_8.png)
Caution
All URLs shown here are for presentation purposes. Each bot will have URLs unique to it.
Create a Slack App
- Sign in to your Slack workspace by clicking here.
![Slack 1.png 1920](https://files.readme.io/f52057d-Slack_1.png)
- Go to the Slack API website and click on Your Apps in the top right corner.
- Click the Create an App button.
![Slack 2.png 1891](https://files.readme.io/6696104-Slack_2.png)
- Select the From scratch option.
![Slack 3.png 1920](https://files.readme.io/0cc28f7-Slack_3.png)
- Enter the App Name and select a workspace from the drop-down menu.
- Click the Create App button.
![Slack 4.png 1920](https://files.readme.io/5a79e40-Slack_4.png)
Configure Messages Tab
- Go to App Home under Features section in the sidebar.
- Scroll down to the Show Tabs section and switch on the Messages Tab toggle.
- Enable the tick box against Allow users to send Slash commands and messages from the messages tab.
![Slack 4.5.png 1889](https://files.readme.io/a4ab785-Slack_4.5.png)
Configure Redirect URLs
- Go to OAuth & Permissions under Features section in the sidebar.
- Scroll down to the Redirect URLs section and click the Add New Redirect URL button.
- Enter the Redirect URL copied from the Gupshup website there and click the Add button.
![Slack 6.png 1005](https://files.readme.io/0cf07a2-Slack_6.png)
Configure Event Subscriptions
To enable events:
- Go to Event Subscriptions under Features section in the sidebar.
- Click on the Enable Events toggle.
- A Request URL section will appear. Enter the request URL copied earlier from the Enabling events section on the Gupshup website.
![Slack 9.png 1884](https://files.readme.io/b925f69-Slack_9.png)
To subscribe to events:
- Go to Event Subscriptions under Features section in the sidebar.
- Scroll down and click Subscribe to bot events.
- Click on the Add Bot User Event button.
![Slack 10.png 1007](https://files.readme.io/fceac8d-Slack_10.png)
- Find and add all the mandatory events mentioned below -
Mandatory Bot events:
- message.channels
- message.groups
- message.mpim
- message.im
- channel_created
Optional Bot events:
- file_change
- file_created
- file_public
- file_shared
- Link_Shared
Optional Workspace events:
- im_open
- im_created
Warning
Please note that for existing bots only Bot events should be selected. If workspace event is selected it requires im:read permission which will lead to republishing of the bot.
- Click on the Save Changes button.
Enable Interactive Components
- Go to Interactivity & Shortcuts under Features section in the sidebar.
- Switch on the Interactivity toggle.
- A Request URL section will appear. Enter the request URL copied earlier from the Enable Interactive Components section on the Gupshup website.
- Click on the Save Changes button.
![Slack 11.png 1891](https://files.readme.io/ae94d68-Slack_11.png)
Gather Slack App credentials
- Go to Basic Information under Settings section in the sidebar.
- Scroll down and find the App Credentials section.
- Copy the credentials shown there to be submitted to Gupshup later.
![Slack 12.png 1891](https://files.readme.io/df36aeb-Slack_12.png)
Submit Credentials
- Log in to the Gupshup website.
- Go to Dashboard tab > My Bots section.
- Select the button under the Publish column against the bot you wish to publish.
- A list of channels will appear. Click on the Publish button against Slack.
- Scroll down and click Submit credentials.
- Enter the required information copied earlier from the Slack API website.
![Slack 13.png 742](https://files.readme.io/d78fbc1-Slack_13.png)
Updated over 2 years ago