Skip to main content
Question

API: How to delete/empty values


Forum|alt.badge.img+3

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.

Mauricio11
Forum|alt.badge.img+11
  • Valued Contributor
  • June 5, 2020

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


Forum|alt.badge.img+3

I can delete some values values, but I'm having no luck with phone_number and position.


Mauricio11
Forum|alt.badge.img+11
  • Valued Contributor
  • June 8, 2020

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


Forum|alt.badge.img+20
  • Employee
  • June 8, 2020

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.


Forum|alt.badge.img+3

Ahaaa, that explains it, thanks a lot!


Mauricio11
Forum|alt.badge.img+11
  • Valued Contributor
  • June 11, 2020

@Sam.Fortuna

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


Forum|alt.badge.img+20
  • Employee
  • June 11, 2020

@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.


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