
With the release of iOS 12, Siri Shortcuts has become available. You can define processes in a GUI programming-like manner from the “Shortcuts” app.
In the past, I created a Lambda Function to set up a Minecraft multiplayer server and wrote an article about invoking it from Slack's Slash Commands.
This time, I made it possible to invoke this Lambda Function from Siri Shortcuts instead of Slack, allowing you to start the server with the call "Hey Siri, start a Minecraft server."
Here’s how it works. (It seems to be executing multiple times, and error logs are flowing into Slack 🙇)
Mechanism#
The mechanism is roughly as shown in the diagram below; I simply changed the endpoint of the API Gateway that was previously invoked from Slack's Slash Commands to be invoked from Siri Shortcuts.

Creating the Shortcut#
Creating a Siri Shortcut is easy; you just need to send a POST request with parameters to the API Gateway endpoint, resulting in a short definition like the one in the image below. I connected an action that executes an HTTP request to "Get Contents of URL" under the action that specifies the URL, and simply specified the request method and parameters.

After that, just record a phrase to execute it with "Hey Siri," and you're done.


Thoughts#
Creating Siri Shortcuts is fun and easy, like GUI programming, all done on the iPhone! This time, I only sent an API request, but with control structures including condition branching, you can write a wide variety of processes, which opens up a lot of possibilities.