slack-status-jeremy

 

 I try to be a good Slack user.

That means keeping my status updated at all times to reflect my whereabouts and availability – but who has the time to open Slack, tap around, and peruse emojis? I’ve long wanted a Today View widget on iOS that would let me just swipe over and set my status with a tap or two. There are a few existing apps that provide this functionality, but they are all just okay. (Sorry Slack status app makers!)

Fortunately, with the releases of iOS 12, Apple has integrated their acquisition of Workflow deep into the platform with Siri Shortcuts. Shortcuts provides a way to automate various tasks through a drag-and-drop scripting interface. You can prompt for input, add conditional logic, and invoke features of native and third-party applications. Apple advertises Siri as the primary way to invoke shortcuts, but they can also be activated within… a Today View widget!

Great, we now know where to start. Unfortunately, despite having a fairly wide variety of built-in app integrations, Shortcuts does not provide an easy way to interact with Slack. I was hoping that Slack’s URL scheme API would allow for the setting of statuses, but it’s only used for deep linking. Without these easy integrations, we’re left with one powerful option:

✨ HTTP requests ✨ 

HTTP is the backbone of the web. It’s what’s used to view web pages, talk with Alexa, and fetch the photos in your Instagram feed. Shortcuts provides a method to interact with any site on the web using HTTP. With a little bit of effort, we can communicate with any service that offers an API, freeing us from the need of official integration with Shortcuts. Of course, we don’t want to do TOO much effort. Working with Slack’s API requires use to register an application in their developer console, fiddle with permissions, and carefully construct the proper HTTP request.

Zapier saves the day. With a web full of products offering API access, Zapier acts as the switchboard operator that connects the wires that let services talk to each other. Even better, they already have a Slack integration that let’s you update your Slack status! So that’s one end of the connection. What’s the other?

The other end of the connection is a Zapier webhook. A webhook is a fancy term for a standard old URL that you access via HTTP. There’s really nothing special about it. It’s how the web works. The powerful part of it though is that we can send ANYTHING to that webhook and pass it off to the service on the other end of the Zapier connection.

So it’s Shortcuts ➡ Zapier ➡ Slack.

In Shortcuts, we define a workflow that prompts the status we want to use and constructs a very simple JSON object.

image3

 

This JSON is sent to the Zapier webhook, or a Catch Hook as they call it, and the values are mapped to the Slack status fields.

image1

And then check Slack…

image2

…and done!

Download the Slack Status Shortcut. You’re on your own for the Zapier part.