Posted on 06-04-2020 07:28 AM
Hi
I'm attempting to use the PUT /computers/serialnumber/{serialnumber} API endpoint to perform updates.
Adding/updating entries works fine.
What's the trick in removing values from the record in Jamf? ex replace a phone number with a blank field.
Adding an empty XML tag or a tag containing a space character does not work.
Posted on 06-04-2020 11:45 PM
Hello Henrik
I've done a test here with the computer UUID to remove a value and works fine, no need of spaces, just the tags.
Example of my test
Hope this helps
Regards
Posted on 06-06-2020 11:28 AM
I can delete some values values, but I'm having no luck with phone_number and position.
Posted on 06-08-2020 01:20 AM
Hello Henrik
I can confirm that is happening here too, the API to PUT "empty" info returns 201 but nothing changes.
New info like "N/A" is OK (a possible workaround?)
Via the UI one can remove the info and leave blank.
I think this is a call to Jamf Support
Regards
Posted on 06-08-2020 05:46 AM
The phone_number
and position
fields are part of the user object not the device, and should be updated via the /users/id/{id}
endpoint instead of via the device record those users are associated with.
Posted on 06-08-2020 10:53 AM
Ahaaa, that explains it, thanks a lot!
Posted on 06-10-2020 11:27 PM
Hello Sam
Thanks for that!
I've managed to change those values via the computer end point (not to empty but to a new value).
Would that be a possible issue/conflict between endpoints?
Regards
Posted on 06-11-2020 06:24 AM
@Mauricio I'm not sure what the intended behavior is here, but considering you can update the values without using the /users
endpoint to certain values and not others, I would consider that inconsistency a product issue. It's possible the fix would be to prevent changing of those values via endpoints other than /users
, but that's not necessarily bad. It's probably worth opening a support ticket.
One thing to keep in mind when updating values associated with user objects is that any other devices also associated with that user will have their values updated as well. Intuitively this makes more sense when you're interacting with the /users
endpoint, but since you're able to update those values via both the /computers
and /mobiledevices
endpoints, it may not be as apparent that this could impact more than just the specific device record you're modifying.