Tag: google calendar

Google日历API – 通过电子邮件邀请参加者

我正在尝试创build一个NodeJS API来添加一个事件到谷歌日历。 该活动正在日历上添加,但与会者没有收到邀请电子邮件。 但是,组织者在活动开始前一天收到电子邮件(设置提醒时间)。 这是我的代码 exports.setCalendar = function(request,response){ var addEventBody = { 'status':'confirmed', 'summary': 'Google I/O 2015', 'description': 'A chance to hear more about Google developer products.', 'sendNotifications': true, 'organizer': { 'email': 'sujith@toobler.com', 'self': true }, 'start': { 'dateTime': request.body.startdate, }, 'end': { 'dateTime': request.body.enddate }, 'attendees': [ { 'email': 'sujith@toobler.com', 'organizer': true, 'self': true, […]

Google Calendar API v3推送通知不尊重timeMax或timeMin

所以你好人好, 我正在使用Google Calendar API和node.js在一个小窗口(大约24小时)内为与事件相关的推送通知注册webhook。 我的timeMin和timeMax参数没有被尊重,我的webhook正在与日历的任何变化(在边界和越界)。 我试过包括singleEvents : true ,从我的时间戳,各种时区偏移string – Z (即.toISOString() ),+ +00:00 ,和+0000 – 我只使用一次性事件(没有重复事件)。 我正在使用有效的OAuth令牌,而不是服务帐户。 我的要求工作正常否则,目前看起来像这样: GCal.events.watch({ auth: _oa2Client, calendarId : calID, singleEvents : true, timeMax : timeMax.toISOString().replace('Z', '+00:00'), timeMin : timeMin.toISOString().replace('Z', '+00:00'), resource : { id : channelID, type: 'web_hook', address : config.google.CALENDAR_EVENTS_WEBHOOK_URL, token: querystring.stringify(token), expiration: timeMax.getTime() } }, callback); 对于我的生活,我无法弄清楚我做错了什么。 […]

使用Google Calendar与node.js同步资源

背景 我一直在node.js中设置一个推送通知客户端来监视用户的日历/事件的变化。 设置calendar.events.watch完美工作,我收到myapp.com/notifications sync通知,以及所有推送通知表示日历中的变化。 问题 现在,当需要轮询这些更新的事件时,我发现最好通过遵循Google的“同步资源”演练来获取syncToken并逐步获取事件。 在他们的java例子中,它们是如何获取,存储和刷新syncToken的。 但是,我似乎无法find任何types的文档(或任何其他人使用它们)node.js. 题 如何获取初始syncToken在日历上执行初始同步? 或者我一直在寻找错误的关键字,或者node.js框架中目前不支持这个function,这让我感到惊讶。 上下文 这是我的代码,我解释为“完全初始同步”。 这是此处列出的快速入门的延续。 var google = require('googleapis'); … function listEvents(auth) { var calendar = google.calendar('v3'); calendar.events.list({ auth: auth, calendarId: 'ZZZZZZZZZZZZZZZZZZZ', timeMin: (new Date()).toISOString(), maxResults: 10, singleEvents: true, orderBy: 'startTime' }, function(err, response) { if (err) { console.log('The API returned an error: ' + err); […]

googleapis TypeError:authClient.request不是nodejs中的函数

我正在使用谷歌日历googleapis和谷歌身份validation 。 我有抓取calendar event列表,但当我尝试插入事件,然后它会抛出一个错误,即TypeError: authClient.request is not a function in nodejs. 这是我的代码片段: – //route.js … app.get('/auth/google', passport.authenticate('google', { scope: ['profile', 'email', 'https://www.googleapis.com/auth/calendar'] })); … //server/passport.js … var google = require('googleapis'); var googleAuth = require('google-auth-library'); … passport.use(new GoogleStrategy({ clientID: configAuth.googleAuth.clientID, clientSecret: configAuth.googleAuth.clientSecret, callbackURL: configAuth.googleAuth.callbackURL, passReqToCallback: true }, function(req, token, refreshToken, profile, done) { … var clientSecret […]

NodeJS JWT Sign.sign TypeError:不是缓冲区

我目前正在研究一个应该在google日历中创build事件的node.js应用程序。 在我的机器上(OS X 10.9.2),它运行良好,但在另一台机器上(Debian 7 Wheezy 64位)却不起作用。 两者都安装了相同的node.js版本:v0.10.26。 我总是得到以下错误: crypto.js:398 var ret = this._binding.sign(toBuf(key)); ^ TypeError: Not a buffer at Sign.sign (crypto.js:398:27) at createRS256Signature (/path/to/node_app/node_modules/googleapis/node_modules/gapitoken/node_modules/jws/index.js:75:58) at jwsRS256Sign (/path/to/node_app/node_modules/googleapis/node_modules/gapitoken/node_modules/jws/index.js:68:21) at Object.jwsSign [as sign] (/path/to/node_app/node_modules/googleapis/node_modules/gapitoken/node_modules/jws/index.js:32:12) at GAPI.getAccessToken (/path/to/node_app/node_modules/googleapis/node_modules/gapitoken/gapitoken.js:56:25) at GAPI.getToken (/path/to/node_app/node_modules/googleapis/node_modules/gapitoken/gapitoken.js:35:14) at JWT.refreshToken_ (/path/to/node_app/node_modules/googleapis/lib/auth/jwtclient.js:83:13) at /path/to/node_app/node_modules/googleapis/lib/auth/jwtclient.js:64:12 at /path/to/node_app/node_modules/googleapis/node_modules/gapitoken/gapitoken.js:20:17 at fs.js:266:14 导致此错误的代码: this.jwt = new googleapis.auth.JWT( SERVICE_ACCOUNT_EMAIL, SERVICE_ACCOUNT_KEY_FILE, […]

使用API​​将ics文件导入到Google日历中

有没有任何可能的解决scheme,使用他们的API将ics文件导入到Google日历中。 我已经提到了这么多的博客,并找不到任何确切的解决scheme,我的需要。 我在一个节点应用程序中工作,并使用节点模块创buildics文件。 请帮我找一个解决scheme。 提前致谢

Google Calendar API Nodejs

我正在尝试使用Google Calendar API和NodeJS,因此我遵循官方教程: https : //developers.google.com/google-apps/calendar/quickstart/nodejs我来到步骤4:运行示例。 当我开始运行它时:node quickstart.js 它说: "No upcoming events found." 我不明白。 我如何访问此日历?

Google Calendar API v3服务帐户在创build活动时不会发送通知

我正尝试使用Google服务帐户创build日历事件(在其自己的日历中)并邀请一些与会者。 当我使用服务帐户和JWT身份validation创build事件时,事件已成功创build,但被邀请者不会收到电子邮件通知 – 请参阅下面的代码。 如果我使用客户帐户,则会发送电子邮件通知,但是我不想诉诸于此。 难道我做错了什么? var google = require('googleapis'); var SCOPES = ['https://www.googleapis.com/auth/calendar']; var key = require("./API-Project-key.json"); var jwtClient = new google.auth.JWT(key.client_email, null, key.private_key, SCOPES, null); jwtClient.authorize(function(err) { if (err) { console.log(err); return; } createEvent(jwtClient); }); /** * @param {google.auth.OAuth2} auth An authorized OAuth2 client. */ function createEvent (auth) { var calendar = google.calendar('v3'); […]

持续访问Google Calendar API

我如何请求访问用户的日历一次 ,然后查询事件,而不必再次请求访问? 是否有一个访问键,只要它没有被撤销,可以授予连续访问权限? 我目前在运行express + mongodb的nodejs应用程序中使用google-calendar模块。 以下示例显示了进行OAuth请求并redirect回应用的部分代码。 这很好。 我想要的是,只要我有权限,就可以随时查询用户的事件。 这将用于预订应用程序,一旦用户注册他们的公共Google日历,允许其他人看到他们的可用性。 我已经看过Google Calendar API文档,但是我无法弄清楚我需要的持续访问需要什么。 configuration : var GoogleCalendar = require('google-calendar'); var google_calendar = new GoogleCalendar.GoogleCalendar(config.google.clientId, config.google.clientSecret, 'http://localhost:3000/authentication'); 显示路线 : app.get('/display', function(req, res) { // redirect user to Google Authentication var access_token = req.session.access_token; if(!access_token) { req.session.authReturn = req.url; return res.redirect('/authentication'); } google_calendar.listCalendarList(access_token, function(err, calendarList) { // […]

Google日历推送API节点不工作?

下面是我的代码: var google = googleapis; var OAuth2 = google.auth.OAuth2; var oauth2Client = new OAuth2('xxxxxx', 'xxxxxxx', 'https://bt-feedback.meteor.com/oauth2'); oauth2Client.setCredentials({ access_token: 'xxxxxxxx', refresh_token: 'xxxxxxxx' }); google.options({ auth: oauth2Client }); // set auth as a global default var calendar = google.calendar('v3'); calendar.events.watch({ calendarId: 'xxxxxxxxxxx' }, { id: 'xxx-xx-xx-xx-xxxxxxxxxx', address: 'https://bt-feedback.meteor.com/notifications', type: 'web_hook' }, function(err, res) { console.log("err, res:", err, […]