How to set user manager in Google Directory api

拥有回忆 提交于 2019-12-13 03:05:28

问题


I have a requirement to set the manager field on each User within my Google Apps domain. Previously I've used the API to update organisations, phones addresses etc. However, I do not see where to actually set/update the user manager field.

I'm using the Java client library to update the user accounts.


回答1:


When creating or updating a user, one of the properties is "relations", in that property you can add the relation with other users and the type of relation, in this case it would be "manager"

Here you can find the documentation: https://developers.google.com/admin-sdk/directory/v1/reference/users

hope it helps.




回答2:


Hopefully this will save others experiencing similar issue a lot of time and effort. This issue was due to a custom field set using the profiles api and is no longer accessible via the newer Directory API. In this case the UserRelation was enough to set the value on a new field but not the existing field. Eventually i had to contact Google Support to see what they recommended, however they indicated that there was no method to update via API and that only method open to us was to remove this field from the users profile.



来源:https://stackoverflow.com/questions/28438758/how-to-set-user-manager-in-google-directory-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!