Google Drive API Error Daily Limit for Unauthenticated Use Exceeded

后端 未结 2 1883
灰色年华
灰色年华 2020-12-11 11:42

Im getting error on using Google API. having right to connect with Google Drive and add new sheet and insert data into it.

It was working till yesterday but when i r

2条回答
  •  忘掉有多难
    2020-12-11 12:28

    I was using NodeJS to download a file, but was forgetting to pass the auth.

    Initially I was using:

    function downloadFiles() {
      const service = google.drive('v3');
      const dest = fs.createWriteStream('/tmp/foo.csv');
      const fileId = '12345_ID_GOES_HERE';
    
      service.files.export({
        fileId: fileId,
        mimeType: 'text/csv'
      });
    }
    

    afterwards, I added an auth argument to the function, and passed it to the export method as well:

    function downloadFiles(auth) {
      const service = google.drive('v3');
      const dest = fs.createWriteStream('/tmp/foo.csv');
      const fileId = '12345_ID_GOES_HERE';
    
      service.files.export({
        auth: auth,
        fileId: fileId,
        mimeType: 'text/csv'
      })
    }
    

    I am getting auth by creating an instance of google-auth-library

提交回复
热议问题