Get list of users with name, phone number and group memberships from G Suite

雨燕双飞 提交于 2019-12-12 05:28:29

问题


I have looked into the G Suite admin APIs and found this function:

GET https://www.googleapis.com/admin/directory/v1/users

I get a list of all users, but no users in the list have a phone number. How can I include the user's phone number in the list?

I would also like to know how to get a list of every user's group memberships if this is possible.


回答1:


The phone number property is under user Resource which you might have missed since it's also located in the Users.list under Response.

  {
  "kind": "admin#directory#users",
  "etag": etag,
  "users": [
    users Resource
  ],
  "nextPageToken": string
}

which when you click leads to the full User Resources which then contains the phones property including others.

"phones": [
    {
      "value": string,
      "primary": boolean,
      "type": string,
      "customType": string
    }
  ],
  "phones": string


来源:https://stackoverflow.com/questions/45105446/get-list-of-users-with-name-phone-number-and-group-memberships-from-g-suite

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