Posted on 03-27-2024 10:39 AM
In the UI my users are _absolutely_ assigned computers, yet they do not appear in my API response. This shouldn't be a permissions thing. I'm very confused. Anyone seen this before?
Solved! Go to Solution.
Posted on 03-28-2024 12:54 AM
Making an assumption that you are developing a script to call the assigned computer per user?
I'd suggest reviewing your path syntax to get a name or ID you'd need to go down to the next tag level. Example below shows xpath usage which will 100% return the name of the computer assigned to the username being filtered on. You can also use text() to strip out the meta tags and just have the data. Hope this helps.
curl -s -k -H "Authorization: Bearer $bearerToken" -H "content-type: text/xml" -X GET "$url/JSSResource/users/name/username" | xmllint --xpath '/user/links/computers/computer/name' -
Posted on 03-28-2024 12:54 AM
Making an assumption that you are developing a script to call the assigned computer per user?
I'd suggest reviewing your path syntax to get a name or ID you'd need to go down to the next tag level. Example below shows xpath usage which will 100% return the name of the computer assigned to the username being filtered on. You can also use text() to strip out the meta tags and just have the data. Hope this helps.
curl -s -k -H "Authorization: Bearer $bearerToken" -H "content-type: text/xml" -X GET "$url/JSSResource/users/name/username" | xmllint --xpath '/user/links/computers/computer/name' -
Posted on 03-28-2024 10:21 AM
This did the trick! Thank you so much!
I'm still very confused at how/why the response from Jamf is so weird. I'm used to just clean, straight JSON.