DreamHouse Slash Commands for Slack
Slack Slash commands implementation for the DreamHouse sample application.
Follow the instructions below to create your own instance of the bot:
Step 1: Install the DreamHouse App
If you haven't already done so, follow these instructions to install the DreamHouse sample application.
Step 2: Create a Connected App
If you haven't already done so, follow the steps below to create a Salesforce connected app:
In Salesforce Setup, type Apps in the quick find box, and click the Apps link
In the Connected Apps section, click New, and define the Connected App as follows:
- Connected App Name: MyConnectedApp (or any name you want)
- API Name: MyConnectedApp
- Contact Email: enter your email address
- Enabled OAuth Settings: Checked
- Callback URL: http://localhost:8200/oauthcallback.html (You'll change this later)
- Selected OAuth Scopes: Full Access (full)
- Click Save
Step 3: Deploy the Slash Commands
Make sure you are logged in to the Heroku Dashboard
Click the button below to deploy the Slash Commands on Heroku:
Fill in the config variables as described.
- For SF_CLIENT_ID, enter the Consumer Key of your Salesforce Connected App
- For SF_CLIENT_SECRET, enter the Consumer Secret of your Salesforce Connected App
- For SF_USER_NAME, enter the the username of your Salesforce integration user
- For SF_PASSWORD, enter the the username of your Salesforce integration user
- Leave SLACK_HOUSE_TOKEN blank for now.
Step 4: Create the Slash Command in Slack
In a browser, go to the custom integration page for your Slack team. For example
YOUR_TEAM_NAMEwith your actual team name.
Click Slash Commands, and click Add Configuration
In the Choose a Command input field, type /house and click Add Slash Command Integration
In the Integration Settings section:
- Command: /house
- URL: the URL of the app you deployed on Heroku followed by /house. For example:
- Method: POST
- Copy the token, open another browser tab, login to the Heroku Dashboard, and set the Heroku SLACK_HOUSE_TOKEN config variable to the value of that token (Setting>Reveal Config Vars)
- Customize Name: DreamHouse
Click Save Integration.