How to use api key to access the Google Drive
问题 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. My code so far: 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') } }); Errors: