Need Jamf Api Help

New Contributor


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>"




Honored Contributor II
Honored Contributor II

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.

Contributor II

@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: 

Second one: