Google api 谷歌日历API返回“;每日限额“;
我正在使用nodejs-googleapis模块来验证google日历API。我设法得到了一个访问令牌。我的代码如下:Google api 谷歌日历API返回“;每日限额“;,google-api,google-calendar-api,google-cloud-console,Google Api,Google Calendar Api,Google Cloud Console,我正在使用nodejs-googleapis模块来验证google日历API。我设法得到了一个访问令牌。我的代码如下: var tok = { access_token: 'ya29.XXXXX-XXXXXXX', refresh_token: '1/XXXXXXXXXXX', scope: 'https://www.googleapis.com/auth/calendar', token_type: 'Bearer', expiry_date: 1569089181800
var tok = {
access_token: 'ya29.XXXXX-XXXXXXX',
refresh_token: '1/XXXXXXXXXXX',
scope: 'https://www.googleapis.com/auth/calendar',
token_type: 'Bearer',
expiry_date: 1569089181800
}
const calendar = google.calendar({version: 'v3', tok});
calendar.events.list({
calendarId: 'primary',
timeMin: (new Date()).toISOString(),
maxResults: 10000,
singleEvents: true,
orderBy: 'startTime',
}, (err, res) => {
});
每次运行此命令时,我都会收到以下错误:API返回一个错误:错误:超出未经验证使用的每日限制。继续使用需要注册。
无法理解为什么会出现这种情况(因为它以前是有效的,我只使用了少量请求)。我已在Google云控制台中启用计费并启用/禁用/重新启用日历API。由于历元值对应于
Sep 21 2019 17:30:00 UTC/GMT
我想你需要一个新的令牌嗯,我明白了,但我刚刚通过了身份验证流程并授予了访问权限,为什么会出现这种情况?可能是API方面的一些内部验证,更改值是否有帮助。我不确定我是否完全遵循,你建议我如何更新它?谢谢。我认为您可能需要加入步骤I。您的代码在旧令牌过期后从身份提供商检索新的访问令牌和刷新令牌。您从哪里获得访问令牌和刷新令牌?