0

I'm having this daily limit problem with my ruby code when I try to issue a download request. This is a test program so I am running it in my terminal. I just call the ruby file.

I've followed this guide to quickly get into the Google Drive API.My code is pretty similar to that guide other than my scopes which are:

            SCOPE = ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.appfolder", "https://www.googleapis.com/auth/drive.metadata"]

The credentials I am using is oAuth Service Key with "other" selected.

This is the line of code making the call.

            content = HTTP.get('https://www.googleapis.com/drive/v3/files/' + file_id + "?alt=media").body

This is the error I am getting from the HTTP call.

            {
            "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 followed this link and created all the necessary credentials to get it working, but still have had no success. Google Drive API is also enabled in my project.

How can you fix this error even after you've set up the Google API project and its credentials?

Edit: Wanted to note that I have search and upload working with the same code. Download is the only one that is giving me errors.

Community
  • 1
  • 1
RoRails
  • 45
  • 7

1 Answers1

0

All the suggestions given here are not up to the mark . This is a routine error that Drive API throws and can be easily handled .As soon as you get the error , you can again request the Drive API to consider your request by using a strategy called exponential back-off . This ensures that you make a call to Drive API again , after a specified amount of time . There is a documentation about this issue by Google and is a common issue when you send too many requests at a time .Check this link right here, it is the answer to all your problems that you are facing https://developers.google.com/drive/v3/web/handle-errors#errors_and_suggested_actions . And also request an additional Quota from Google Developers Console . Additional quota can be requested under the Quotas tab in Google Developers Console. You might be lacking enough quota to make the request . The details for same are given in the link i posted above. You should create an account and request Quota as being an unauthenticated user your requests won't last long.Use Google OAuth to authenticate yourself into the Drive API.

Saurabh Chaturvedi
  • 2,028
  • 2
  • 18
  • 39