- #Jamf pro classic api how to#
- #Jamf pro classic api update#
- #Jamf pro classic api pro#
- #Jamf pro classic api password#
- #Jamf pro classic api mac#
Why? It has to do with which way that data is expected to flow. If you look closely, GET is using different headers than PUT and POST are: The header should look like this for XML input: The header should look like this for JSON output: The header should look like this for XML output:
#Jamf pro classic api pro#
Instead, the Jamf Pro server receives and executes the command to delete the specified data. The reason why DELETE is an exception is that we’re not sending or receiving any XML or JSON data. By specifying XML or JSON using the header, we avoid this issue. Without this header specification, you should get XML but Jamf Pro may send back JSON instead.
#Jamf pro classic api password#
Authentication – In this case, we’re using the username and password of a Jamf Pro user with the correct privileges to run the API command.Tool being used – In this case, we’re using curl.
![jamf pro classic api jamf pro classic api](https://media.jamf.com/images/news/post-printers.png)
When sending one of these commands to Jamf Pro, you must include the following: When using the Classic API, there are four commands available:
#Jamf pro classic api mac#
In contrast, a number of XML parsing tools (like xmllint and xpath) are installed as part of macOS Catalina and earlier, which means that the Mac admin can currently rely on them being available if the Mac admin needs to run API-using scripts on managed Macs. However, they are not installed as part of macOS Catalina or earlier which means that its up to the Mac admin to make sure the relevant JSON parsing tools are installed and up to date on the Mac admin’s managed Macs. There are tools available for macOS which allow easy JSON parsing and manipulation, with jq being an excellent example. While you can both input and output XML, JSON can only be output.
#Jamf pro classic api update#
Update – January 3, 2020: As Graham Pugh pointed out in the comments, I made a mistake originally on what can be done with JSON, where I stated that both JSON input and output were supported. There are not tools installed as part of macOS which allow JSON parsing and manipulation when using Bash shell scripting.
![jamf pro classic api jamf pro classic api](https://media.jamf.com/images/news/7-tips-and-tricks-for-using-the-classic-api.jpg)
There are various tools installed as part of macOS which allow XML parsing and manipulation when using Bash shell scripting.Both XML input and output and JSON output are supported:.The Classic API has been around the longest, so more Jamf Pro admins are familiar with it.The reasons that the Classic API is most used at this time are the following:
#Jamf pro classic api how to#
Of the two, the Classic API is the one currently most used by Jamf Pro admins and the one I’ll be focusing on how to use it, using XML for input and output.
![jamf pro classic api jamf pro classic api](https://d3grfap2l5ikgv.cloudfront.net/59822132ca753d719145cc4c/public/5f6190695d67071c8fffb26e.png)
When working with Jamf Pro, one way to save yourself a lot of clicking in the admin console is to use one of the two current Jamf Pro APIs.