gpt4 book ai didi

jquery - Google 日历 API 中的 "keyExpired"

转载 作者:行者123 更新时间:2023-12-03 22:52:55 32 4
gpt4 key购买 nike

从今天开始,我的网站与我的 GCal 出现连接问题。 (从一个月起就一直运行良好)。

我通过 jQuery GET 调用 GCal:

https://www.googleapis.com/calendar/v3/calendars/{MY_CALENDAR}/events?key={MY_API_KEY}

响应是(JSON):

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

我不明白为什么 key 过期。你能帮我吗?我还没有在 api key 上读过关于固定时间生命周期的内容。我没有超出每日配额。

抱歉我的英语水平。

谢谢。

最佳答案

keyExpired事件由 OAuth 1.0 流程触发:

If the user approves your application's access request, Google issues an authorized request token. Each request token is valid for only one hour. Only an authorized request token can be exchanged for an access token, and this exchange can be done only once per authorized request token.

OAuth 2.0具有不同的不基于时间的到期触发器。

You should write your code to anticipate the possibility that a granted token might no longer work. A token might stop working for one of these reasons:

The user has revoked access.

The token has not been used for six months.

The user changed passwords and the token contains Gmail, Calendar, Contacts, or Hangouts scopes.

The user account has exceeded a certain number of token requests.

引用文献

关于jquery - Google 日历 API 中的 "keyExpired",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14403843/

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