dailyLimitExceededUnreg for Drive API v3
See original GitHub issueHi, I read lots of docs on developers.google, set up my codebase recently, connected within service account’s provided secret_key.json issued for the project on Google Cloud Console which I downloaded & put away safely (hopefully its safe) . Everything seemed fine . Although I get status: 200 with request : { responseURL: https://www.googleapis.com/drive/v3/files?q=trashed%3Dfalse&corpora=user' }
the expected JSON for responseURL contains the following message:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
I’ve checked on documentation , it say quotas may be an issue . Answer is negative , my quotas for Google Drive API is only 0,01%
I may missing a part, but do I need to add billing account before hand for such API “trialling” only ? I am just a regular developer trying to play around with G Workspace APIs.
Environment details
- OS: Windows Home 10 Windows Feature Experience Pack 120.2212.3920.0
- Node.js version: 16.13.2
- npm version: 8.1.2
googleapis
version: 0.3.0
Steps to reproduce
My codebase:
'use strict';
const drive = require('@googleapis/drive');
const path = require('path');
/* const express = require('express'); */
/* const axios = require('axios'); */
async function main() {
const auth = new drive.auth.GoogleAuth({ /* as if AuthPlus.GoogleAuth({options}) */
keyFile: path.join(__dirname, 'secret_key.json'),
/* keyFilename: path.join(__dirname, 'secret_key.json'), */
scopes: [
/* Full list of scopes : @https://developers.google.com/identity/protocols/oauth2/scopes#drive */
'https://www.googleapis.com/auth/drive', /* : See, edit, create, and delete all of your Google Drive files */
'https://www.googleapis.com/auth/drive.file', /* : View and manage Google Drive files and folders that you have opened or created with this app */
'https://www.googleapis.com/auth/drive.appdata', /* : ... */
'https://www.googleapis.com/auth/drive.metadata', /* : ... */
'https://www.googleapis.com/auth/drive.metadata.readonly', /* : ... */
'https://www.googleapis.com/auth/drive.photos.readonly', /* : ... */
'https://www.googleapis.com/auth/drive.readonly', /* : ... */
],
});
// Raw reference : @https://googleapis.dev/nodejs/googleapis/latest/drive/classes/Resource$Files.html#list
// Nice reference : @https://developers.google.com/drive/api/v3/reference/files/list
const _authenticated = drive.drive({version: 'v3', auth})
const res = await _authenticated.files.list({
q: 'trashed=false',
corpora: 'user'
})
console.log(res); // full response : for more , please refer to request.responseURL
console.log(res.data.files.length); // 0 # not what expected
}
main().catch(e => {
console.error(e);
throw e;
});
Full response I get:
{
config: {
url: 'https://www.googleapis.com/drive/v3/files?q=trashed%3Dfalse&corpora=user',
method: 'GET',
userAgentDirectives: [ [Object] ],
paramsSerializer: [Function (anonymous)],
headers: {
'x-goog-api-client': 'gdcl/5.0.5 gl-node/16.13.2 auth/7.11.0',
'Accept-Encoding': 'gzip',
'User-Agent': 'google-api-nodejs-client/5.0.5 (gzip)',
Authorization: 'Bearer some_opaque_string_hidden_from_you_guys',
Accept: 'application/json'
},
params: { q: 'trashed=false', corpora: 'user' },
validateStatus: [Function (anonymous)],
retry: true,
responseType: 'json'
},
data: { kind: 'drive#fileList', incompleteSearch: false, files: [] },
headers: {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"',
'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
connection: 'close',
'content-encoding': 'gzip',
'content-security-policy': "frame-ancestors 'self'",
'content-type': 'application/json; charset=UTF-8',
date: 'Sun, 06 Feb 2022 22:43:19 GMT',
expires: 'Mon, 01 Jan 1990 00:00:00 GMT',
pragma: 'no-cache',
server: 'GSE',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '1; mode=block'
},
status: 200,
statusText: 'OK',
request: {
responseURL: 'https://www.googleapis.com/drive/v3/files?q=trashed%3Dfalse&corpora=user'
}
}
Worth to mention: my secret_key.json expires in thousands of years (status: enabled)
It’s not urgent, although some assistance may be appreciated to solve or register as potential bug for this library .
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
i have this same issue… very lost.
@sofisl I am not sure it’s somewhere mentioned on developers.google or any other relevant docs (references) that "you must share the document (in this case – sheet) to service account to be accessible through for APIs, although it may be obvious to some advanced users , but not beginners whatsoever . Thanks !