获取导出csv的请求会出现错误“403每日限制未经验证的使用超出”。

时间:2017-05-24 12:45:04

标签: oauth-2.0 google-drive-api google-oauth

我正在使用drive + sheet api。目前,我想以csv格式导出excel表,但在获取请求时我在控制台中收到了错误。

    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. 

1 个答案:

答案 0 :(得分:0)

您还没有包含http Authorization标头,因此您的应用未经授权。未经授权的应用程序的每日限制恰好为零。

我建议: -

1 /了解Google OAuth以及如何授权应用并进行经过身份验证的请求。

2 /学习在StackOverflow上搜索现有问题。这个问题已被多次询问和回答,例如Receiving error 403 in Google Drive API - Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup