API Script - Inventory Update via Smart Device Group - "Unknown Error Submitting PUT XML"

mcs-jamf
New Contributor

Hi all,

I am having some issues with a python script to update inventory in a smart group.

I am using the Jamf pre made script from GITHUB. My environment is Jamf 10.5 on Windows Server 2016, I have tried to run this script from both a Windows and Mac machine. The script finds the smart group, finds the devices in that smart group via JSS device ID, however get an error "Unknown Error Submitting PUT XML"

I have spent the last couple of days with Hayden from Jamf support who has been fantastic. I am new to python and keen to see if anyone has a fix out there.

Thanks heaps,

Aaron99f1705853f4451595e1be0701b2b0e4

2 REPLIES 2

FrozenWaltDisne
New Contributor III

That's a very generic response from the API. There is no troubleshooting information from that response. I would verify a couple things.
1. Device ID Exists
2. Check XML that you are submitting to the devices for errors.

The Error itself basically says it doesn't know what to report.

BradB
New Contributor III

Looks like it's failing within the submitDataToJSS function in that script, so I would try to replicate what it's doing there via curl or Postman. Should be something like this in curl:

curl -X PUT https://yourjssurl.com/JSSResource/mobiledevices/id/{id} --header 'content-type: application/xml' --header 'authorization: Basic {BASE64_ENCODED_CREDS}' --data '<mobile_device><command>UpdateInventory</command></mobile_device>'

Replace {id} with the id of a device and stick your base64 encoded credentials into the authorization header. That should display a better error message for troubleshooting.