【问题标题】:Trying to run google API quickstart for gmail, followed all steps to the point but getting error尝试为 gmail 运行 google API quickstart,按照所有步骤进行操作,但出现错误
【发布时间】:2019-09-29 15:58:40
【问题描述】:

尝试使用 gmail API 从电子邮件中提取附件。 尝试快速入门 (https://developers.google.com/gmail/api/quickstart/js) 时出现此错误

我尝试等待密钥需要一些时间才能生效,但这没有任何作用,还尝试了新密钥。

<pre id="content" style="white-space: pre-wrap;"></pre>

<script type="text/javascript">

  // Client ID and API key from the Developer Console

  var CLIENT_ID = 'MY ID';

  var API_KEY ='MY KEY'

  // Array of API discovery doc URLs for APIs used by the quickstart
  var DISCOVERY_DOCS = ["https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest"];

这是我在网络浏览器中得到的输出。

{
  "error": {
    "errors": [
      {
        "domain": "usageLimits",
        "reason": "keyInvalid",
        "message": "Bad Request"
      }
    ],
    "code": 400,
    "message": "Bad Request"
  }
}

【问题讨论】:

    标签: javascript html gmail gmail-api


    【解决方案1】:

    这似乎与这个问题非常相似 - Google Simple API key stopped working

    转到您的 API 密钥 - https://console.developers.google.com/apis/credentials

    在 API 限制部分选中单选按钮“不限制密钥”, 或者确保将 Gmail API 添加到列表或受限 API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-12
      • 2011-07-02
      • 2016-08-06
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2011-09-04
      • 2021-06-16
      相关资源
      最近更新 更多