Google Drive API Error Daily Limit for Unauthenticated Use Exceeded

后端 未结 2 1854
灰色年华
灰色年华 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:24

    The problem was while getting access token. I was not providing correct scopes. When i changed the scope to

    https://spreadsheets.google.com/feeds https://docs.google.com/feeds https://www.googleapis.com/auth/drive.file

    it worked fine

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题