A demo bot which allows to use Bandwidth services inside Slack chat
- Node 7.5+ and MongoDb 3.0+ OR Docker 1.10+ and Docker Compose
- External https access (via port forwarding like
ngrok, VPS, etc)
If you use Node directly install dependencies by
# Install dependencies (Node-way only) npm install # or via yarn yarn install
Go to Slack Apps console and create new Slack application. Fill environment variables
SLACK_VERIFICATION_TOKEN by values from created application (section
# For Node-way export SLACK_CLIENT_ID = <your-slack-app-client-id> export SLACK_CLIENT_SECRET = <your-slack-app-client-secret> export SLACK_VERIFICATION_TOKEN = <your-slack-app-verification-token>
Go to tab
Slack Commands and add command
/sms like in the picture. Use url like
Go to Catapult dashboard and copy
Api Token and
Api Secret. They will be required later.
Now you can run the app by
# Node-way (Mongo should be ran before this step, set DATABASE_URL to with valid url to your mongo db instance) npm start # Docker-way PORT=3000 docker-compose up -d # web app will be available on port 3000
Configure port forwarding to open external access if need (like
ngrok http 3000).
Open in browser next link (replace
SLACK_CLIENT_ID by your Slack App client id)
Select team where you would like to use this application. On next page select channel for incoming messages.
After that you will be redirected to this app site to fill Catapult auth data. Press "Save" to complete authorization and see your new phone number for messages.
Send in Slack
/sms <phone_number> <message_text>
If team member filled phone number in profile you can send SMS using user name like
/sms @user_name Hello there
All incoming SMSes will be shown in special channel which you entered on authorization phase.