Google 目录 API:对此 API 管理方法的请求已被阻止

Google Directory API: Requests to this API admin method are blocked

我正在尝试使用 customers.get API 获取客户域。我已经在同意屏幕中添加了范围:

但是我在执行请求后收到此错误消息(看起来像权限问题):

{
  "error": {
    "code": 403,
    "message": "Requests to this API admin method ccc.hosted.frontend.directory.v1.DirectoryCustomers.Get are blocked.",
    "errors": [
      {
        "message": "Requests to this API admin method ccc.hosted.frontend.directory.v1.DirectoryCustomers.Get are blocked.",
        "domain": "global",
        "reason": "forbidden"
      }
    ],
    "status": "PERMISSION_DENIED"
  }
}

出于某种原因,在 Google 的 API Explorer 中运行完美,但在我的 API 客户端(Insomnia)和我的 Web 应用程序中运行不佳。在我的网络应用程序中,我使用 JavaScript 客户端库设置范围。

此外,我正在使用 Google Drive、Docs APIs,它们运行良好。

这个 API 是不是我遗漏了什么?

谢谢。

我解决了这个问题。原因是我的 API 密钥在 Google 控制台云中被限制了 2 API 秒:

  • Google 文档 API
  • Google 开车 API

所以我不得不将 Admin SDK API 添加到限制列表中:

之后我的请求按预期工作。谢谢。