我想使用 Google 的 REST API 访问公共日历。
Google 的日历 API 建议我需要一个 OAuth 令牌才能访问日历:
https://developers.google.com/google-apps/calendar/auth
但是,我正在访问公共日历并且正在从服务器执行此操作,因此不能/不应该要求用户进行身份验证。
我正在使用 node.js api:
googleapis
.discover('calendar', 'v3').execute(function(err, client) {
client.calendar.calendars.get({ calendarId: '***@group.calendar.google.com' })
.execute(function (err, response) {
console.log('response from google', response);
});
});
这将返回“您的客户发出了格式错误或非法的请求。这就是我们所知道的。”
调用.withApiKey('***')
after.calendars.get()
返回相同的错误。
有什么建议么?