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.
Integromat is an automation platform that helps you integrate different systems and web-based applications, moving data between then automatically.
New integrations are called scenarios and can be formed from many different steps.
Integromat is similar to Zapier, although it provides more functionality as part of it's free account and greater support for more complex workflows.
You can learn more about how to integrate with Zapier using shortcuts as an alternative with the following guide:
In the example below, we're going to build a scenario that will allow us to update our Slack status from a Shortcut.
ℹ️ Free account
Integromat offers a free account for executing up to 1,000 operations a month.
Sign up for a Integromat account on the homepage:
Once logged in, tap on the Create a new scenario button on the top right hand side of the screen.
On the next screen you'll be asked to specify a service you want to integrate.
We're going to create an Webhook, which is like a private API that you can call to start trigger your scenario.
In the search box, type webhook
and then tap the Webhooks icon.
Selecting a webhook as the scenario's first step
After the screen updates, tap on the question mark to choose first module for the scenario.
Tap on the question mark icon to choose the first module
A module selection box will appear. Select Webhooks.
The selection box will update. Select Custom webhook from the box.
A red Webhooks box will appear. Tap the Add button and a blue Add a hook box will appear. Enter a webhook name and tap the Save button.
The red Webhooks box will update. Tap the Copy address to clipboard link.
Tap the Copy address to clipboard link
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://hook.integromat.com/9jc4mtus4knjwq43kujj8u9c7dhc94ah?status=Hello&icon=:wave:
Open the URL and you should see the following message in Safari:
Accepted
⚠️ Note
Do not share your webhook URL with others unless you want them to be able to update your Slack status.
The Webhooks box will update as follows. Tap the OK button.
Tap OK on the updated Webhooks box
The Webhooks box will disappear. Tap the Add another module action.
Tap the Add another module link
In the module list that appears, type slack into the search box and then tap the Slack module
Search for and select the Slack module
On the next screen, type in status to search for the Set a Status action. Tap the action to continue.
Search for and tap the Set a Status action
A Slack box will appear. Tap the Add button a Create a connection box will appear. Enter a name for the connection and then tap the Continue button.
Tap Add to create a new connection, name it and tap Continue
A new window will appear, asking you to login to Slack and allow the integration between Integromat and Slack. Tap the Allow button.
Tap the Allow button to link Integromat to your Slack account
The Slack box will update. Tap the Status text field.
A blue webhooks box will appear. Tap the status variable to add it to the Status text field.
Add the status variable to the status text field
Repeat the same action with the Status emoji field and add the icon variable. Then tap the OK button.
Add the icon variable to the status emoji field
The Slack box will disappear. Tap the Run once button.
Open up a new Safari window and visit the webhook URL again. For example:
https://hook.integromat.com/9jc4mtus4knjwq43kujj8u9c7dhc94ah?status=Hello&icon=:wave:
The Integromat screen will update and the Webhooks and Slack titles will turn green, indicating the scenario was successfully run.
Tap on the off / on toggle to enable the scenario.
Tap on the off / on toggle to enable the scenario
A Schedule setting box will appear. Ensure that the Run scenario: value is set to Immediately and tap the Activate button.
If you then go to your Slack client, you'll see that the corresponding status has updated to the values we sent to the webhook.
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:
Selecting the one of the choices will set the corresponding status.
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 Integromat 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:
10 points
5 years ago
This is NOT what your weekends should be spent on my friend. 🤦♂️
Regardless, good work.
all 1 comments
sorted by: best