14

我正在尝试使用Admin SDK Directory API,特别是检索用户详细说明的用户信息:获取端点

我在 oauth 时请求了以下权限

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 for Nonprofits 版上进行了尝试,并得到了同样的错误。Admin SDK Directory API 是否需要 Google Apps for Business 帐户?

4

2 回答 2

24

您需要在 G Suite 控制面板中启用管理 API 。

于 2013-07-26T19:17:25.660 回答
3

我很困惑。这是否意味着如果我们的应用程序在 Google Apps Marketplace 中列出,安装我们应用程序的域仍然需要手动启用管理 API?

于 2014-05-21T15:04:09.947 回答