Skip to main content
Question

Need Jamf Api Help


Forum|alt.badge.img+1

Hello, 

I am new to jamf and api 

I am trying to understand jamf api. I am trying to update the information under ios device - user and location - department. add or remove the information

here is the basic code i wrote from piece mealing from different place but no luck

 
    -H "content-type: application/xml"
    -H "accept: application/xml"
    -d "<mobiledevices><location><department>Students</department></location></mobiledevices>"

 

 

2 replies

stevewood
Forum|alt.badge.img+35
  • Employee
  • 1797 replies
  • June 27, 2022

Your begining and ending tag is wrong. Instead of '<mobiledevices>' and '</mobiledevices>' it needs to be '<mobile_device>' and '</mobile_device>'.

Also, the department you use has to already exist in the Jamf Pro list of Departments (Settings -> Network Organization -> Departments), otherwise you'll get an error.


Forum|alt.badge.img+9
  • Valued Contributor
  • 123 replies
  • June 30, 2022

@Silentgaming if you have time, I suggest you do this.  

2 guys from Jamf technical services gave a presentation to a MacAdmins conference a few years ago where they outline how to query the Jamf API's in scripts.  I watched both those videos and learn a TON!  Grab a pot of coffee, some lunch and watch these two videos and they'll help.  All in all, the total time is 2 hours invested in learning how to do this.  

First one: https://www.youtube.com/watch?v=GKw0XbHx1GM&t=3459s 

Second one: https://www.youtube.com/watch?v=xgSFxUMh7Dg&t=3740s 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings