Message buttons and the Slack API

New APIs + new capabilities = totally awesome

Message Buttons mark the biggest change to the Slack API since its inception.

They’re deceptively simple — a bit of UI that lets users interact with your apps directly. They’re available in the Slack API and can be added to any existing app. They operate within message attachments, allowing up to five buttons in a single message that fire off any process you need when clicked by users.

They make your apps easier to use — no longer do users have to remember precise commands — they can just click the button for the function they want, when they want it.

For developers it’s the same story; your bots won’t have to parse human language as much if you let users make direct choices. The result is a new way of building apps for Slack, one that relies less on complex multi-step interactions, while letting you increase user engagement within Slack.

We think this is going to usher in a whole new world of apps built for Slack. Let’s look at some sample apps released today to get the ideas flowing.

Resolve issues with Pagerduty

Pagerduty lets users review incoming alerts and mark them as acknowledged or resolved, right from Slack. Using the chat.update API method, messages posted to channels show results in real-time as buttons are clicked, including who marked events as resolved. This both saves a trip to web browser and shows a record of which team member responded to issues.

Pay your teammates back with Current

Current allows you to send your team members money via Slack. The app combines slash commands with Message Buttons to make their Slack app extremely simple to use.

An especially impressive aspect of Current’s updated app is how they handle support requests, through a combination of Message Buttons, slash commands, and bot users.

Current live support on Slack

Lunch train

We’ve also built a reference app for you to try out. At Slack’s San Francisco office, food trucks appear every Monday, Wednesday, and Friday and quickly became a tradition for employees. Slack channels would fill up with chatter as people made plans for when to arrive to beat the crowds, so we built an app that makes coordinating that easier, and shows off Message Buttons.

You start by proposing a time and destination, and post it into a channel where others can see.

Colleagues seeing the message can tap the button to Board the train.

Using chat.update in the Slack API, the host gets a running tally of who is going (without triggering new messages) along with the option of delaying or canceling the lunch trip.

Shortly before the agreed time, everyone gets a Slackbot reminder to meet up and meet for lunch.

After the event, messages update to past tense and display who took part.

To test out Lunch Train you can install it to your team.

Build with buttons

If you’ve already built an app for Slack, check the API documentation on Message Buttons. If you’re still considering what kind of app to build for Slack, know that Message Buttons offer direct interactions, and can greatly simplify your application’s flow. If you need help getting started, the crew over at Howdy updated Botkit to include demo code with Message Buttons.

As of today, over 500 apps are available in our App Directory. We want to thank the entire developer community for helping propel the Directory from just an idea last winter into an incredible resource for millions of users, all over the course of just a few months, and we can’t wait to see what you build next.


If you want even more examples, we’ve included a few more demos in the SlackHQ post about Message Buttons.