Getting Gmail Inbox using node.js and google-api
<p>My Code follows,(above code is same as given in the example of nodejs in google developer site.)</p>

<pre><code>function listLabels(auth) {

      var gmail = google.gmail({ auth: auth, version: 'v1' });

      var emails = gmail.users.messages.list({
          includeSpamTrash: false,
          maxResults: 500,
          q: "",
          userId: 'me'
      }, function (err, results) {
          console.log(results.messages);
      });
    }
</code></pre>

<p>I'm getting array of objects containing IDs and threadIds</p>

<p>Now, if i input these IDs</p>

<p>into these</p>

<pre><code>   function getMessage(messageId,auth) {
  var requestt = google.gmail({ auth: auth, version: 'v1' }).users.messages.get({
    'userId': 'me',
    'id': messageId
  });
  console.log(requestt)
  requestt.execute(function(response){
    console.log(response);
  });
}
</code></pre>

<p>I am getting error,</p>

<pre><code>TypeError: requestt.execute is not a function
    at getMessage (/home/jay/Projects/gmailwebapi/index.js:122:11)
    at /home/jay/Projects/gmailwebapi/index.js:113:7
    at OAuth2Client._postRequest (/home/jay/Projects/gmailwebapi/node_modules/google-auth-library/lib/auth/oauth2client.js:381:3)
    at postRequestCb (/home/jay/Projects/gmailwebapi/node_modules/google-auth-library/lib/auth/oauth2client.js:343:10)
    at Request._callback (/home/jay/Projects/gmailwebapi/node_modules/google-auth-library/lib/transporters.js:103:7)
    at Request.self.callback (/home/jay/Projects/gmailwebapi/node_modules/google-auth-library/node_modules/request/request.js:198:22)
    at emitTwo (events.js:100:13)
    at Request.emit (events.js:185:7)
    at Request.&lt;anonymous&gt; (/home/jay/Projects/gmailwebapi/node_modules/google-auth-library/node_modules/request/request.js:1057:14)
    at emitOne (events.js:95:20)
</code></pre>