问题描述
我正在尝试获取根组织的组织名称.但是,在下面的API中,我无法将orgUnitPath发送为空.
I am trying to get the organization name of root organization. However in the below API, I cannot send orgUnitPath as empty.
https://developers.google.com/admin-sdk/directory/v1/reference/orgunits/get
关于如何实现这一目标的任何想法?
Any idea on how to achieve this?
推荐答案
是旧话题,但我回答自己的样子可能还是一样好.您可以通过至少一种方式获得根OU,虽然它不是很漂亮,但是可以工作.
Old topic, but I might just as well answer, as I was looking myself.You can get the root OU, in at least one way, it's not pretty, but it works.
首先,您使用 Orgunits:列表获取单位的完整列表.您将遍历它们,直到找到带有parentPath ="/"的单元.然后,您获取该单元的parentId并执行 Orgunits:get 使用所说的"parentId"作为"orgUnitPath".
First you use Orgunits: list to get a complete list of the units. The you loop through them until you find a unit with parentPath="/". Then you take the parentId of that unit and do a Orgunits: get using said "parentId" as "orgUnitPath".
Voila .../亚当
Voila.../Adam
这篇关于google directory api-根组织单位路径的组织名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!