Shortcuts and Jamf APIs: Customize and Extend Your Jamf Experience
With Damian Cavanagh, PreSales Engineer, CompNow (Australia)
Jamf’s APIs provide admins with a powerful toolset for advanced device management.
Apple’s Shortcuts automation utility can interact with these APIs, enabling greater customization and flexibility for admin workflows and an even better user experience.
Thanks for watching my session at JNUC! Or knowing someone who did…
All the Shortcuts used in the session are available for you to download and experiment with below. Feel free to share this page with colleagues who may be interested – if these Shortcuts save admins as much time as I hope they will, I’d like as many as possible to hear about it!
Please send any feedback or questions to me via the MacAdmins Slack – I’m @d.cav.
If you’d like an update when I add more Shortcuts to this page, please send me an email here and I’ll add you to a list.
Below, I will talk you through all of the shortcuts and provide links to download them.
Depending on your device/browser security settings, you may have difficulty downloading the Shortcut files – they may be interpreted as scripts. (Keeping things on the JNUC theme, downloading them might trigger an alert in Jamf Protect!)
If you run into this issue, please use the iCloud link instead – If you are using the OneDrive then once open choose to open in another app and choose Shortcuts and it will work for you.
Generate Test Device Serial Number QR Code
Before we get to the actual shortcuts, I want to help you avoid the hassle of printing a serial number QR code label while you’re just experimenting. This Shortcut will prompt you to enter the serial number of your test device when you install it. I recommend you run this on your own Mac, with the test device beside it, and your iPhone/iPad in your hand running the Shortcuts.
If using multiple test devices, you can duplicate the Shortcut and enter a new serial in the existing Text action.
Shortcut Download Link (OneDrive) or Shortcut Download Link (iCloud)
HOW TO USE THE SHORTCUTS
-
Jamf Pro:
First, create a Jamf Pro account for exclusive use with these Shortcuts, and add permissions as noted below for only the Shortcuts you wish to test.
Then, before you install any Shortcuts, download ToolBox Pro from the App Store and create two Variables:
Jamf Pro URL – https://yourdomain.jamfcloud.com
Jamf Pro API Auth – username:password (Shortcuts handles the base64 encoding)*Using Variables in TBP does not require an in-app purchase
After completing these steps, download the Shortcut file(s) on your iPhone/iPad, or download on Mac and AirDrop/email etc -
Jamf School:
Get your Network ID from Devices/Enrol Device(s), and then create an API key via Organisation/Settings/API
Then, before you install any Shortcuts, download ToolBox Pro from the App Store and create two Variables:
Jamf School URL – https://yourdomain.jamfcloud.com
Jamf School API Auth – NetworkID:APIKey (Shortcuts handles the base64 encoding)*Using Variables in TBP does not require an in-app purchase
After completing these steps, download the Shortcut file(s) on your iPhone/iPad, or download on Mac and AirDrop/email etc -
On Security:
Some organisations may not permit usage of their MDM’s API in this fashion – please check on this!
The TBP variable approach is the best solution I have been able to come up with to avoid having auth details in the Shortcuts themselves. TBP uses iCloud for storage/syncing which I find secure enough, but do not use on a mobile device without passcode/Touch ID/Face ID.
Replacing TBP Variables with Text Actions with the relevant data is an alternative.
Jamf Pro – Main
JP – Mac – Get Computer & User Info
Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)
Description:
Return computer & user information.
-
Required Modules
- JP – Mac – Get computer record from serial
- JP – User – Get User record from username
-
Permissions:
- Read – Computers
- Read – Users