title: How to use api key to access the Google Drive
body: <p>I am trying to use  apiGoogle Node.js client library to access the Google Drive API so I can upload some files to my drive account. </p>
  
  <p>My code so far:</p>
  
  <pre><code>var drive = google.drive({ version: 'v3' });
  drive.apiKey = "API_KEY"
  drive.setScope = "https://www.googleapis.com/auth/drive.file"
  
  drive.files.create({
      resource: {
          name: 'text.text',
          mimeType: 'text/plain',
          parents:['1ATscm2nsE9KpjA66iXHB9jnMrbyik7PP']
      },
      media: {
          mimeType: 'text/plain',
  
          body: fs.createReadStream('files/text.text')
  
      }
  });
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code> errors: 
     [ { domain: 'global',
         reason: 'required',
         message: 'Login Required',
         locationType: 'header',
         location: 'Authorization' } ] }
  </code></pre>
  
  <p>Can anybody help to resolve this issue?</p>