Oauth 2.0 获取导出csv的请求时出现错误“;403超出未经认证使用的每日限额。”;
我使用的是驱动器+工作表api。目前,我想以csv格式导出excel工作表,但在发出get请求时,控制台中出现了错误Oauth 2.0 获取导出csv的请求时出现错误“;403超出未经认证使用的每日限额。”;,oauth-2.0,google-drive-api,google-oauth,Oauth 2.0,Google Drive Api,Google Oauth,我使用的是驱动器+工作表api。目前,我想以csv格式导出excel工作表,但在发出get请求时,控制台中出现了错误 function exportFirstCsv(excelId) { $.ajax({ url: "https://www.googleapis.com/drive/v2/files/" + excelId + '/export', type: "GET",
function exportFirstCsv(excelId)
{
$.ajax({
url: "https://www.googleapis.com/drive/v2/files/" + excelId + '/export',
type: "GET",
data: {
mimeType: 'text/csv'
},
success: function(response) {
console.log('Now here');
console.log(response);
},
error: function(xhr) {
}
});
}
got error : {
"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 want to export the file.
您没有包含http
授权
标题,因此您的应用未经授权。未经授权的应用程序每天都有一个上限,恰好是零
我建议:-
1/阅读有关Google OAuth以及如何授权应用程序和发出经过身份验证的请求
2/学习搜索有关StackOverflow的现有问题。这个问题已经被问过很多次了,例如,我也厌倦了同样的请求,用api键作为查询参数,但问题仍然是一样的。如何进行授权调用使用OAuth 2.0访问Google API的所有步骤都已完成。我有刷新令牌,并且我已完成访问令牌的重新生成。您能给我发送一个正确的url,我们必须通过get请求才能将文件导出为csv格式吗?在您的代码中,您在哪里设置了HTTP“Authorization”头?