“Application programming (or program) interface: a set of protocols used by programmers to create applications for a specific operating system or to interface between the different modules of an application.” ~Dictionary.com
and click, when you can automate? A point-and-click GUI (graphical user interface) relies on real-time human-interaction every time you want to do something. An API allows you to tell a computer to accomplish the same thing in an automated fashion.
Terminology Authentication - Credentials needed to securely execute a task Endpoint - Where on the application the data/record is held Call/Request - Initiate communication with the application Response - Data/confirmation of request/action
Actions/Verbs GET - Retrieve desired information POST - Create a brand new record PUT - Update an existing set of info or record DELETE - Permanently remove info or record
(Request) cURL/curl - Tells the computer to perform the request Flags “-skH”: s - Silent/suppress output k - Proceed without verifying server certs H - Headers, dictates style/type of text to communicate with server (json vs xml)
via API Flag “-u” tells the curl the next string/data is specifying the credentials needed to perform task Basic authentication or token-based auth But how do I use it? (Auth)
request to Endpoint (i.e. JSSResource/computers) - Must specify a folder/segment/category of data in order to execute a task or gather data Account used in authentication must have permission to perform tasks within endpoint But how do I use it? (Endpoint)
use ‘xmllint --xpath' to isolate specific data. Add ‘text()’ to the end of the path to strip XML elements That’s cool…so? Command Location of data in XML
by ID Parsing: Get value(s) from response body from an API call xmllint: Tool used to extract XML from response Parsed result: Admin’s Mac Mini That’s cool…so?
“-d” sends data with PUT/POST request Specify type of data sending “content-type” Jamf Pro accepts XML for PUT/POST/DELETE Device name adjusted to: “C07HH52NDJD2” That’s cool…so?
the things? Automated task examples • Push/Remove restrictions based on time • Automate the generation of complex reports • Enforce branding/naming • Automate onboarding by creating 3rd party SaaS accounts • Automate management commands • Remediate security/compliance issues
https://github.com/jamf/JamfMigrator - Move records from a Jamf Pro instance to another Jamf Pro instance (i.e. Test to Prod) • https://github.com/mike-levenick/mut - Automate the population of records in your Jamf Pro • https://github.com/jamf/JAWA - Utilize this webhook server to automate your processes based on triggers/actions • https://github.com/kc9wwh/JamfProGroupsScoped - Find out what policies, profiles and apps are scoped to specific groups in your Jamf Pro • https://github.com/rustymyers/jamfMDMTools - Send automated MDM commands to devices
feedback by completing the 2-question session survey in the JNUC 2019 app. UP NEXT Common Pitfalls of Jamf Administration and How to Fix Them 10:15-11:00 am