Is there a way to dynamically assign a device based on the current logged in user for use with Apple Classroom for Student mac or for any purpose thereof using the API?
You don't even need to use the API.
Decide how you want to grab the user to assign it to ($Username in the below command) and run:
/usr/local/jamf/bin/jamf recon -endUsername $Username
@Eigger, in order to do what @hkabik suggested, you also need to make sure that Collect user and location information from LDAP is checked.. This can be enabled by navigating to Computer Management>Inventory Collection in the JSS Settings.
Collect user and location information from LDAP
Nice! good to know, will test and report back. Thank you both!