gpt4 book ai didi

javascript - 尝试为 gmail 运行 google API quickstart,按照所有步骤进行操作,但出现错误

转载 作者:行者123 更新时间:2023-11-28 02:23:12 25 4
gpt4 key购买 nike

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

我试着等待,以防 key 需要一些时间才能生效,但这什么也没做,还尝试了新 key 。

<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"
}
}

最佳答案

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

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

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

关于javascript - 尝试为 gmail 运行 google API quickstart,按照所有步骤进行操作,但出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56099669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com