Google api 使用API密钥的Google Cloud Resource Manager API身份验证

Google api 使用API密钥的Google Cloud Resource Manager API身份验证,google-api,Google Api,根据该协议,可以使用API密钥对请求进行授权。我不能让它工作 以下是我的请求: curl -H "Content-Type: application/json" -X POST -d '{"key":"<Some Key>"}' https://cloudresourcemanager.googleapis.com/v1beta1/projects 非常感谢您的帮助。对于非公开信息的请求,oAuth2是必需的。因此,从这个意义上讲,文档是误导性的,因为API密钥对于此类请求无效 您

根据该协议,可以使用API密钥对请求进行授权。我不能让它工作

以下是我的请求:

curl -H "Content-Type: application/json" -X POST -d '{"key":"<Some Key>"}' https://cloudresourcemanager.googleapis.com/v1beta1/projects

非常感谢您的帮助。

对于非公开信息的请求,oAuth2是必需的。因此,从这个意义上讲,文档是误导性的,因为API密钥对于此类请求无效

您还可以通过选择特定调用并使用“尝试此api”来检查任何特定api调用所需的授权类型

下面是指向另一个堆栈溢出问题的链接,该问题的答案解释了从这里开始的方向

{
  "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
  }
}