jun_zhang wrote:
Hi TrentO,
I found the pages you machined and create a command. But when I run the curl command on may mac it just give me 401 erorr.
Would you like to give me more details ?
401 means that you were not properly authenticated when accessing the API. To authenticate you will need to get a bearer token from the 'api/v1/auth/token' endpoint first. Then you would include this token as 'Authentication: Bearer {{TOKEN}}' as a header with the rest of your API requests. Instructions on how to do this are found here (https://developer.jamf.com/jamf-pro/reference/post_v1-auth-token) and here (https://developer.jamf.com/jamf-pro/docs/client-credentials).
This is a bit convoluted unless you are already familiar with using APIs, so I recommend using your instances API docs directly as it provides a nice graphical interface for making one off API calls. Navigate to https://YourJamfServer.com/api/doc/#/jamf-management-framework (replacing YourJamfServer.com with the URL and possibly port to your jamf instance. This will take you to a page which looks like this.

From there you can login using the fields provided using your username and password and click authorize. This is the equivalent of getting the bearer token I mentioned earlier.
Then scroll down to the "jamf-management-framework" section and click to expand.

Click try it out as seen above and then enter the JSS ID of the computer you want to install the jamf binary on in the ID field. Then click execute.

You will see the result of the command in the Responses section below the execute button.
Hope that helps!