Posted on 05-23-2024 01:11 PM
We are building up a python script that fills the Users (Teachers / Students) into the classes with the jamf api. We are doing good so far but we have trouble updating the User Class or Group assignments. We are using the Documentation on https://school.jamfcloud.com/api/docs/
It seems that we can add groups but we want a full upgrade. The user should loose the existing group / class assignments and get the new ones that is in the put. Should we use https://school.jamfcloud.com/api/docs/#api-Users-Update or https://school.jamfcloud.com/api/docs/#api-Classes-Assign_users ?
Posted on 10-11-2024 06:28 PM
You can't modify group memberships of a user with the user update endpoint.
The endpoint to update a class/group lets you only add users to a group but not remove them.
The workaround would be to fetch the existing group, delete it, then recreate the group without the user(s) you want removed from the class.