google-admin-sdk - 使用 Google Admin SDK Directory API 时获取 "Domain cannot use apis"

标签 google-admin-sdk

我正在尝试使用 Admin SDK Directory API ,专门用于检索 Users: get endpoint 中详述的用户信息.

我在 oauthing 时请求了以下权限

https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly

但是,当我请求获取特定用户的信息时,我得到以下响应:
HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=UTF-8
Date: Fri, 26 Jul 2013 18:25:29 GMT
Expires: Fri, 26 Jul 2013 18:25:29 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "domainCannotUseApis",
    "message": "Domain cannot use apis."
   }
  ],
  "code": 403,
  "message": "Domain cannot use apis."
 }
}

我在 API Console 中启用了 Admin SDK .

我已经在 Google Apps 标准(免费)版和 Google Apps 公益版上尝试过这个,但得到了同样的错误。 Admin SDK Directory API 是否需要 Google Apps for Business 帐户?

最佳答案

您需要enable the administrative APIs在 G Suite 控制面板中。

关于google-admin-sdk - 使用 Google Admin SDK Directory API 时获取 "Domain cannot use apis",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17888730/

相关文章:

google-admin-sdk - Google 管理 API - 使用 JSON 的服务帐户 - 403 禁止错误

go - 使用 golang 在 google admin sdk api 上获取 400 invalid_grant。有什么建议么?

firebase - 如何返回文档索引名称值

google-api - 使用服务帐户和授权委托(delegate)调用 Google API 时模拟当前用户

google-apps-script - 以编程方式启用 "Allow less secure apps"?

c# - Google Admin SDK > 目录 API > 用户 > LastLoginTime 不一致

java - 什么是用户速率超出异常?

google-api-java-client - 使用带有 Google Admin SDK 的服务帐户创建用户?

python - Google Apps Admin SDK 取消删除不起作用

用于配置用户 google apps admin-sdk 的 python 代码