directory api - get users using orgName

╄→гoц情女王★ 提交于 2019-12-12 04:53:43

问题


I have four sub-organizations defined. (/AdminOrg, /subOrgA, /SubOrgB, /subOrgA/SubOrgAA)

my directory.orgunits.list query return below data. I store the return array in a variable called orgUnits[]:

http://pastebin.com/Kzud6SAq

I have 4 users in my organization. one in each sub-organization. the users.list return below data:

http://pastebin.com/6ttSgDSe

I am trying to get no. of users within an organization (without including sub organizations in them)

Option 1: The query directory.users.list.query("orgUnitPath=/subOrgA") includes users from sub organization (/subOrgA/SubOrgAA) too and does not meet my needs.

Option 2: I tried the query directory.users.list.query("orgName=orgUnits[]->name"). It queries for users[]->organizations[]->name. And this field is null by default. It does not get populated with orgUnits[]->name.

My questions are

  1. How to populate users.organizations[].name?

  2. Is there any way I can get users within an organization without including sub-organizations in them


回答1:


Unfortunately it isn't possible to search for users within an orgUnit not including sub-orgs. The orginations field in the Users resource, as well as the orgName, orgTitle, orgDepartment, orgDescription, orgCostCenter query parameters, refer to a completely separate set of data that appears to be used by the API only. Only the orgUnitPath field and query parameter operate on the organizations visible within the Google Apps Admin Console.



来源:https://stackoverflow.com/questions/26977562/directory-api-get-users-using-orgname

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