Start tracking your progress
Trailhead Home
Trailhead Home

Get Started with Slack Apps

Learning Objectives

At the end of this unit, you will be able to:

  • Identify the differences between Slack and a Slack App.
  • Identify the components in a Slack App.
  • Explain ways Slack App components can enhance work.

This module was produced in collaboration with Slack, who owns, supports, and maintains the products, services, and features described here. 

What Is a Slack App?

On a quest for more productive work, you can start your adventures in Slack with one core feature, communication

  • There’s direct messaging to have a one-on-one chat with someone you work with.
  • There are channels to open a full conversation with multiple people in your organization.
  • And there’s video calling and screen sharing for those conversations needing more nuanced discussion.

But on this quest for better productivity, you shouldn’t go it alone. You want more features. You need to integrate with more systems.

This is when you venture deeper into what makes Slack more than a “chat app,” a collaboration hub designed to move work forward. Enter the world of Slack Apps.

Every adventure requires gear. The Slack App directory is your general store. You can find apps that perform a wide variety of tasks. For example, there are apps to notify your team about code-related issues on GitHub.

GitHub post on Slack that ggruiz opened a pull request with relevant data.

And there are apps to display your customer service tickets on Zendesk.

Zendesk post on Slack that a new ticket was opened by Jonathan Smith with ticket number and inquiry.

And there are apps for finding the perfect GIF to react.

A bot response from giphy saying, “Let’s do this.”

On your adventure with Slack, you also have the power to create your own Slack Apps. Your workplace has its own set of needs. That’s why Slack gives you a set of tools to build almost any kind of integration that you can think of—and this module is here to teach you how to use those tools. 

Slack App Components

Slack Apps are designed to help people get work done. The way you design your app depends on how you expect people to use or encounter it for the first time. Start by finding the use case that most closely matches what you want to build, then read on to learn how to implement the feature that matches your needs.

Slack App Component
Description
Incoming Webhooks

Bring notifications and accompanying data into Slack from other systems.
Slash Commands

Let people direct your app to do something from the text input bar.
Message Actions

Send message content directly to another app or service. Users see an option that appears in the corner of every Slack Message on hover, or on long press on mobile.
Bot Users

Enable your app to chat with other users to help them get work done. This usually involves the use of another set of AI services, like IBM Watson.
Note

Note

Keep in mind that you don’t have to have all of these things to make a Slack App. Some are just bot users. Others are just slash commands. Others only depend on Incoming Webhooks. Some have all three.

Incoming Webhooks

Incoming Webhooks are the easiest way to send content from other systems and services into Slack. Using an Incoming Webhook in your app takes two steps.

  • Getting a Slack-generated URL
  • Sending JSON to it with your message and some options

And that’s it. Easy, right?

Webhooks code directing a Slack App to post “Hello, world” to a specific URL in JSON.

Despite the simplicity, Incoming Webhooks still provide you with a lot of power. You can post “Hello, world!” in a channel.

Your App posts “Hello, world.”

Or you can post something with interactivity.

Your App posts, “Would you like to play a game?” offering the choices of Chess and Go.

They’re useful when you want your app to initiate contact, and a perfect choice for a lot of things that don’t require much more.

For example, if you want your bug trackers to send you a report about ongoing issues, you can set it up to send this report using an Incoming Webhook.

Use Incoming Webhooks when you only want the app to contact you.

Slash Commands

Slash Commands give your users a way to initiate contact with your app. Users type a slash, /, followed by a command that you define, then add some instructions in the form of ordinary text. 

Get this—there are built-in examples that already exist when you use Slack! 

  • Typing /topic Hello! in a channel changes the channel’s topic to Hello!
  • Typing /invite @[someone] in a channel invites a member of your organization into your channel.
  • Typing /remind me to drink water at 3pm every day does, in fact, send you a reminder message every day at 3pm to drink water!

Out in the wild, you have apps like Giphy, which you can use to find a GIF that matches your search terms, typing /giphy [term] to surface the first result.

User types in /giphy trailhead.

By typing /giphy trailhead, giphy responds with an offer to send a GIF of the Golden Gate Bridge, shuffle the GIF, or cancel.

You can start a meeting poll using Polly, by typing /polly When should we meet?

When the user types /polly When should we meet?, the Polly app responds with tools to set up the poll title, type, and to submit to the thread when ready.

And more!

Slash commands work in the following way.

  • A user types a slash command, for example, /weather 94105 .
  • Slack sees that a user invoked the command and sends your app server some data in JSON format.
  • The integration you’ve written parses that data and sends back the appropriate response.

Slash commands enable your users to do something on-demand within Slack. Think Slash Command if you want your user to be able to trigger an action.

Message Actions

Message actions are similar to Slash Commands in that they also let you give your users something to do on-demand. The main differences are:

  • Message Actions bring up potential interaction focused on individual messages, rather than channels.
  • Message Actions give users a visual means of interaction.

With Polly installed, clicking the “...” button opens several options, including the ability to create a poll.

For example, Polly attaches their app to individual messages in order to give users the ability to create a poll around that message.

Herein lies the power of message actions: With Polly’s message action, a user has gained the power to instantly create a poll relevant to their conversation!

Think Message Action if you want your user to be able to trigger actions on single messages.

Bot Users

Bot Users are computerized users that behave just like a regular user and can do nearly anything a user would be able to.

With a Bot User, you can:

  • Monitor a channel’s activity, and act on it.
  • Post messages and react to users.
  • Receive mentions.
  • Integrate with your backend services.

A good example of a Slack App that utilizes a Bot User is Donut.

Donut exists as a regular user with a profile picture and a private channel.

A user messages Donut in a direct message.

Donut encourages people within an organization to meet by pairing them up in private group DMs.

Donut gathering three people into a group message and encouraging them to meet.

It sends you reminders about these meetings in private DMs.

Donut asks the participants if they’ve met.

You can configure your bot to listen to all messages in a channel, or only messages when it's @mentioned. Bots can be a friendly way to help users communicate with apps and services. 

If you want your users to interact with an app that has a personality, use bots!

It’s Just the Beginning

You’ve learned what Slack Apps are.

You’ve learned how users might encounter them in the wild: Interactive Webhooks, Slash Commands, Message Actions, and Bot Users.

You’re doing great! In the next unit, you get to know the essential building block by which all these things operate: the Slack Message. Go forth, adventurer!

Resources

retargeting