Hi,
I am very new to node. I am using expressjs.
Here my requirement is to insert an event to google calendar. After
googling if found following block of code:
var moment = require('moment');var googleapis = require('googleapis');var
GoogleToken = require('gapitoken');var OAuth2Client = googleapis.OAuth2Client;
var token = new GoogleToken({
iss: '*******************@developer.gserviceaccount.com',
scope: 'https://www.googleapis.com/auth/calendar',
keyFile: './*****************.pem'}, function (err) {
if (err) {
return console.log(err);
}
token.getToken(function (err, token) {
if (err) {
return console.log(err);
}
googleapis.load('calendar', 'v3', function (err, client) {
var oauthClient = new OAuth2Client('', '', '', {}, {
token_type: 'Bearer',
access_token: token
});
var now = moment().format();
client
.calendar
.events
.insert({
calendarId: 'primary',
resource: {
summary: 'hangout',
description: 'hangout',
reminders: {
overrides: {
method: 'popup',
minutes: 0
}
},
start: {
dateTime: now
},
end: {
dateTime: now
},
attendees: [{
email: '****@**********.com'
}]
}
})
.withAuthClient(oauthClient)
.execute(function (err, event) {
// event does not contain hangoutLink
console.log(event.hangoutLink);
});
});
});});
But here I dont understand the 'iss', 'scope' and 'keyfile'.
Please help me in this or let me know if any other easy way are there.
My basic requirement to add an event to the calendar.
Thanks
Swarup
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.