Skip to main content
Solved

(Clarification) cURL Update Extensions Attributes

  • January 21, 2022
  • 1 reply
  • 4 views

Forum|alt.badge.img+5

Hey Everybody,

Quick question for you API experts, and apologies in advance.  I'm new to this.  I'd like to update a specific attribute.  I've included some sample XML that's close to what would be grabbed from a specific iPad.

I'd like change "Mrs. Jane Doe" to "Mr. Jon Doe" in "SD-Full Name" of extension attributes.

<?xml version="1.0" encoding="UTF-8"?> <mobile_device> <general> <id>2035</id> <display_name>School Staff iPad Mr. Jon Doe</display_name> <device_name>School Staff iPad Mr. Jon Doe</device_name> <serial_number>B28JDKL1J0CDM</serial_number> ... etc. </general> <extension_attributes> <extension_attribute> <id>2</id> <name>SD-Full Name</name> <type>String</type> <multi_value>false</multi_value> <value>Mrs. Jane Doe</value> </extension_attribute> <extension_attribute> <id>3</id> <name>SD-Notes</name> <type>String</type> <multi_value>false</multi_value> <value/> </extension_attribute> <extension_attribute> <id>1</id> <name>SD-School</name> <type>String</type> <multi_value>false</multi_value> <value>Top Rated School</value> </extension_attribute> </extension_attributes> </mobile_device>

Do I need to send the extension_attributes and all its children in its entirety, or are the <id> and <value> for a specific child node enough for JAMF to know which node I'm updating?

e.g. Would this be enough (contained in $putXML)

<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?> <mobile_device> <extension_attributes> <extension_attribute> <id>2</id> <value>Mr. Jon Doe</value> </extension_attribute> </extension_attributes> </mobile_device>

Script e.g.:

Show content

curl -sX PUT "${jssURL}/JSSResource/mobiledevices/id/$jamfDeviceId" -H "accept: application/xml" -H "authorization: Basic ${jssAuth}" -H "Content-Type: application/xml" -d "$putXML"

 Thanks!

Best answer by NerdMusk

Found my answer.  And script is working great now.  Just updated my entire fleet of iPads via my Google Spreadsheet.  :D

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+5
  • New Contributor
  • January 25, 2022

Found my answer.  And script is working great now.  Just updated my entire fleet of iPads via my Google Spreadsheet.  :D


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