gpt4 book ai didi

javascript - 获取 Google 域中的所有用户。 Google Admin SDK - 用户列表

转载 作者:行者123 更新时间:2023-12-02 22:34:40 24 4
gpt4 key购买 nike

我想调用这个api https://www.googleapis.com/admin/directory/v1/users .

我有一个来自 Google Console 并配置了积分的应用程序。 API key 。

我是我的 Google Gsuite 域的管理员。

我打电话

https://www.googleapis.com/admin/directory/v1/users?domain=xxx-xxx.com&key=xxxxxxxxxxxxxxxxxx

我有这条消息

{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}

我不明白它应该如何工作。

最佳答案

从 G suite 获取所有用户非常简单。您有用于在 this 中列出 Gsuite 用户的代码网页。在左侧面板上选择您现在使用的语言。正确遵循指南。无需更改一行代码。我按照 java Quickstart 列出了 G suite 的所有用户。

你也可以尝试这个 -

  • 您可以使用 Google API Explorer
  • 转到this网页
  • 您可以找到“尝试此 API”iframe,或者只需按右侧面板上的“尝试”按钮即可
  • 引用该页面并提供所需的参数。
  • 只需提供您的域名和 orderBy 作为参数即可。
  • 它将打开一个新窗口并要求身份验证和授权
  • 完成授权后,您的 Gsuite 中的用户将以 JSON 格式显示。

关于javascript - 获取 Google 域中的所有用户。 Google Admin SDK - 用户列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58778734/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com