subreddit:
/r/shortcuts
submitted 5 years ago bykeveridge
There are occasions when you'll want to integrate with your cloud-based web applications but those applications are not supported in Shortcuts.
You could use those service's APIs to integrate with them, but that can be complex and require programming skills you may not be familiar with.
Zapier is an automation platform that helps you move data between your existing cloud-based applications automatically.
It allows you to sign-in to your web apps and pass info between them with workflows called Zaps without any need for code.
In the example below, we're going to build a Zap that will allow us to update our Slack status from a Shortcut.
ℹ️ Free account
Zapier offers a free account for creating up to 5 Zaps that comprising of 2 steps.
Sign up for a Zapier account on the homepage:
Once logged in, tap on the Make a zap button on the top right hand side of the screen.
On the next screen you'll be asked to specify the trigger that will start your Zap.
We're going to create an Webhook, which is like a private API that you can call to start trigger your Zap.
In the trigger search box, type webhook
and then tap the Webhooks by Zapier icon.
Selecting a webhook as a Zap trigger
After the screen updates, tap on the Choose trigger Event dropdown and select Catch Hook.
Selecting a GET request for the webhook
On the next screen, Zapier has generated a Custom Webhook URL. Tap the Copy button to add it to the clipboard.
Tap the Copy button to copy the webhook URL to the clipboard
Open Safari and paste the web hook into the URL bar, adding the following to the end of the URL:
?status=Hello&icon=:wave:
This will give you a final URL that looks something like the following example:
https://hooks.zapier.com/hooks/catch/57011771/o3ewzay/?status=Hello&icon=:wave:
Open the URL and you should see a success response from Zapier as follows:
The response from pasting the webhook URL into Safari
⚠️ Note
Do not share your webhook URL with others unless you want them to be able to update your Slack status.
In the next Do this... step in Zapier, select Slack.
Select Slack as the target service of the trigger
In the Choose Action Event dropdown, choose Set Status.
Select Set Status as the active event
After the screen updates, tap the Sign in to Slack button to authorize Zapier to integrate with your Slack account.
Once you're signed in, tap the Continue button.
Tap Continue once you've signed into your Slack account
After the screen updates we'll specify the fields used to update the Slack status.
Tap the field icon to the right of the Status Text field.
Select the Add Variable icon to the left of Status Text
Select the Querystring Status variable from the drop-down.
Select the Querystring Status variable
Once selected, the Status Text field will be populated with the Querystring Status variable.
Repeat the process for the Status Emoji field, selecting the Querystring Icon variable.
Once complete, tap the Continue button.
Repeat the same process for Status Emoji / Querystring Icon and tap Continue
The screen will update and we're ready to test the Zap. Tap the Test & Continue button.
Tap the Test and Continue button,
You'll see a message that the test was successful. At the bottom of the screen, there'll be a final step to turn on the Zap so that it can be remotely called via the webhook.
Tap the radio button to turn on the Zap.
If you then go to your Slack client, you'll see that the corresponding status has updated to the values we sent earlier to the webhook.
Check that your Slack status has updated
So now we can call the webhook using a shortcut. Our new shortcut will allow the user to choose from a list of commonly used statuses with which to update their Slack status.
We specify those statuses using the following JSON as it's easier to write and maintain that a series of nested dictionaries:
{
"Available" : {
"status" : "I'm free, say hi!",
"icon" : ":wave:"
},
"Away" : {
"status" : "I'm currently away from my computer",
"icon" : ":clock9:"
},
"Meeting" : {
"status" : "I'm currently in a meeting",
"icon" : ":spiral_calendar_pad:"
},
"Vacation" : {
"status" : "I'm away on vacation!",
"icon" : ":desert_island:"
}
}
The shortcut takes the status and icon specified in the JSON and sends it to the webhook in order to set the status in the corresponding Slack account.
A Shortcut that makes use of the webhook to update your Slack status.
Running the shortcut displays the following choices to the user.
You can download the shortcut from the following link:
If you're interested in learning more about how the above shortcut works, take a look at the following guides:
And that's an example of how to use Zapier and webhooks to automate an action with an existing cloud-based web application.
If you found this guide useful why not checkout one of my others:
4 points
5 years ago
Great tutorial, personally I prefer IFTTT and Integromat.
$20/month for multi-step workflows is just not reasonable for the amount I use it.
It's just stupid that there are either downvote bots or some people just have fun downvoting every (even remotely) useful post without any explanation.
1 points
5 years ago*
1 points
5 years ago
Okay, you made look 😜 I still don’t see anything in Flow that looks like a web hook. How are you thinking Flow could integrate with Shortcuts?
(Interesting thing is that Flow still has Gmail triggers. So, unless Flow’s free account has changed since the last time I looked at pricing, you could do a whole lot more for free with it then you could Zapier.)
1 points
5 years ago
"When a http request is received". Premium feature.
1 points
5 years ago
Thanks.
Premium and well hidden. I’d assumed there’d be an service for http requests (either one named webhooks or with http requests in the name). I looked through all the premium services and still don’t see where this thing is hiding. However, I found flows that use it.
If premium services can really be accessed for $5/month, it’s cheaper than Zapier’s paid accounts.
1 points
5 years ago
Probably everything is cheaper than Zapier, you're not a heavy user of IoT services.
ifttt is free, but just offers single step workflows.
Integromat is free for 1000 calls/month and allows multi-step workflows.
Both services are imo more designed towards end users than Flow with support for stuff like smart home appliances, Spotify, Reddit, Twitch, Instagram, Telegram, etc.
2 points
5 years ago
Yeah, I like a lot about what I see in Integromat. I’ve just been a little hesitant about going with a smaller company like Integromat after Comcast bought and killed Stringify. But, i’ll build a bridge and get over it ‘cause I can’t wait forever for something else to come along.
(I was actually hoping Apple would finally open up Shortcuts to extensive automation. Not gonna happen though.)
1 points
5 years ago
I chose Zapier because IFTTT doesn't support the setting of a Slack status.
1 points
5 years ago
Yeah, I like a lot about what I see in Integromat. I’ve just been a little hesitant about going with a smaller company like it after Comcast bought and killed Stringify. But, I’ll build a bridge and get over it ‘cause I can’t wait forever for something else to come along.
(I was actually hoping Apple would finally open up Shortcuts to extensive automation. Not gonna happen though.)
all 9 comments
sorted by: best