【问题标题】:I Enabled my Google drive API, but still I got error code "Project has not enabled the API."我启用了我的 Google 驱动 API,但仍然收到错误代码“项目尚未启用 API。”
【发布时间】:2016-02-20 08:55:14
【问题描述】:

如下图所示,Google drive API 已启用

当我运行我的代码时,我得到了一个错误提示:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "Project has not enabled the API. Please use Google Developers Console to activate the API for your project.",
    "reason" : "forbidden"
  } ],
  "message" : "Project has not enabled the API. Please use Google Developers Console to activate the API for your project.",
  "status" : "PERMISSION_DENIED"

}

我使用了服务帐户方法,我也尝试了 OAuth2.0 客户端 ID,我得到了同样的错误。

启用驱动程序 api 有什么我错过的吗?

注意:

【问题讨论】:

    标签: google-api google-cloud-platform service-accounts


    【解决方案1】:

    您还缺少一个需要 Drive SDK 的工具。

    【讨论】:

    • Thnx @dalmTo 我尝试搜索 Drive SDK,但在 Google API 部分中没有找到“没有 Drive SDK 的结果”。你能告诉我启用它的步骤吗?
    【解决方案2】:

    感谢大家的帮助 我在我的代码中发现了问题,我使用了这一行

    Operation op = service.scripts().run(scriptId, request).execute();
    

    它还需要以下 api (Google Apps Script Execution API) 我必须在其中启用它...

    【讨论】:

      猜你喜欢
      • 2019-07-27
      • 2019-07-19
      • 2014-03-31
      • 1970-01-01
      • 2015-07-01
      • 2021-09-14
      • 2021-03-28
      • 2023-02-04
      • 2020-12-25
      相关资源
      最近更新 更多