【问题标题】:Google API Error 400: "Client project not found"Google API 错误 400:“找不到客户端项目”
【发布时间】:2016-09-24 23:03:25
【问题描述】:

这是我第一次深入研究 Google API。我正在尝试按照 Google 的说明进行简单的测试。至此,我已经创建了项目并设置了凭据。按照 Google 的指示 here,我创建了一个测试页面,并完全按照上面链接中的说明复制了页面代码。

当我运行该页面时,我最初会看到一个授权按钮,它要求我登录自己的帐户。到目前为止一切都很好。但是,一旦我登录 Google,就会收到以下错误:

"{"error": {"code": 400,
            "message": "Client project not found. Please pass a valid project.",
            "status": "INVALID_ARGUMENT",
            "details": [{"@type": "type.googleapis.com/google.rpc.Help",
                         "links": [{"description": "Google developers console",
                                    "url": "https://console.developers.google.com"
                                  }]
                       }]
 }}"

我已经阅读了我能找到的很少内容,没有提到这个特定的错误。

有人遇到这个错误,或者有什么想法吗?

谢谢!

【问题讨论】:

  • 您在第 1 步中遗漏了一些内容,或者您​​没有正确复制您的凭据 Google 无法找到您的项目。

标签: google-api google-analytics-api google-developers-console


【解决方案1】:

啊,解决了!

对于新的 Google API,您需要在开发者控制台中启用 API。

转至:https://console.developers.google.com

在列表中,找到您要使用的 API(对我来说是 Sheets API),点击它并启用它。

它现在就像一个魅力:-)

【讨论】:

  • 知识 api 需要这个。为什么这不在docs 中列出,这超出了我的理解。非常感谢!
  • 我需要启用 Google+ API 作为身份验证的一部分。谢谢!
  • 至少现在错误更有帮助:'Project 999999999 is not found and cannot be used for API calls.如果它是最近创建的,请访问 console.developers.google.com/apis/api/plus.googleapis.com/… 启用 Google+ API,然后重试。如果您最近启用了此 API,请等待几分钟,让该操作传播到我们的系统并重试。'
猜你喜欢
  • 2020-08-05
  • 2013-01-19
  • 1970-01-01
  • 2015-08-17
  • 2015-10-31
  • 2016-03-31
  • 1970-01-01
  • 2012-07-04
  • 1970-01-01
相关资源
最近更新 更多