Posted on 10-17-2018 03:41 AM
Runs but doesnt replace the value in the following <string>often</string> to <string>unset</string>
>>
apiUsername="myuser"
apiPassword="mypass"
jssURL="myurl"
policyID=239
curl -sS -k -u $apiUsername:$apiPassword https://myjssurl/JSSResource/managedpreferenceprofiles/id/$policyID -H "Content-Type: text/xml" -d "<managed_preference_profile><dict><key>idleTime</key><dict><key>state</key><string>unset</string><key>value</key><integer>900</integer></dict></dict></managed_preference_profile>" -X PUT
anyone see my 'obvious' mistake??
Thanks
Posted on 10-17-2018 07:14 AM
The body of the request is missing a bunch of the XML. At minimum, you'll need something like the following:
<managed_preference_profile>
<general>
<plist>XML DATA</plist>
</general>
</managed_preference_profile>
Additionally, you will likely need to encode the XML as described in this KB article. Since you're required to PUT/POST XML to the API and the element name is "plist" it's confusing to the API what is part of the managed preference payload body and what's part of the configuration for the managed preference (within Jamf Pro), this encoding solves that problem.