我一直在尝试获取我的消息的信息,但我只获得了id;其余的是未定义的:
function list(auth) {
var gmail = google.gmail('v1');
gmail.users.messages.list({
auth: auth,
userId: 'me',
}, function(err, response) {
if (err) {
console.log('The API returned an error: ' + err);
return;
}
var messages = response.messages;
if (messages.length == 0) {
console.log('No messages found.');
} else {
console.log('messages:');
for (var i = 0; i < 2; i++) {
var message = messages[i];
console.log('- '+ message.id +' '+ message.threadId);
}
}
});
}