Wrote my first Slack Slash Command!

I'm surprised at how easy it was to do. I went into the slack web interface and created an app through there and enabled the slash commands, then added a new slash command that posts to an API end-point. I wrote an API end-point in my application at work to return a JSON with the different AB tests we have on production for each of our web sites recently so I wanted to point to that. I used {"code":"200", "message":"24,145,146"} as the return but Slack uses "text" instead of "message" so I added a new endpoint that called the same function but with a 'slack' flag and if the flag is true it writes the output to "text" instead of "message" and then slack dumps that into the channel when it receives the slash command. I went back into the web interface and installed the app to the team. Super easy to do and now my front-end team that doesn't have access to the application but constantly needs to know which tests are on production have a simple way to get it without asking me! Empowering users, and saving my time. I like it!

Published on 05 May 2017 at 16h53 by Dave, tags , ,

comment Wrote my first Slack Slash Command!

Powered by Publify | Photo Startup stock photos