I\'m trying to get familiar with the Google Drive API using the official Java sample. However, after wasting a few hours and attempting to set the sample up two times, I\'m
In my experience, "403 Quota Exceeded" always stems from the HTPP Authorization header not being set.
As per your logs it seems that your 404 error is caused by a 403 error returned on the request to the Drive API.
Errors from Google APIs usually contains an explanations in their body. In your case:
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit Exceeded. Please sign up",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit Exceeded. Please sign up"
}
}
This one would typically mean that you have not enabled access to the Google Drive API on your Google APIs Console project. In order to do this:
This is all described in the Get started > Register an App section of our documentation. You should also make sure that you go through the other sub-sections of Get started.
I eventually managed to get it working. I'm not sure what was the problem before, but here are some tips for those who are facing similar problems:
The "Client ID for web applications" and the "Client ID for Drive SDK" confused me. Unfortunately the documentation doesn't tell you which one to use at which place, but it seems like you only need the "Client ID for web applications".
If you update your Chrome extension or the API console it could take some time until Drive recognizes those changes. For example, changing the OAuth Client ID in the API console could take some time until it takes effect, since everybody's caching. If you are testing your application, deleting cache and cookies helps speed up the process.
Good luck with your applications, and thanks to everybody who helped me!
I used the java OAuth code distributed in Google's dredit sample for a program that goes through the "opens with" flow and likewise recieved the 403 error.
I had to dig into the OAuth code to find the problem, the source of which I haven't seen mentioned elsewhere in regard to the 403 error. Essentially the ExchangeCode method of CredentialMediator assumes there is only one redirect uri and this is the one you are hoping to go to. This wasn't the case for me and resulted in a CodeExchangeException.
To resolve you could massage the list of uris in the client_secrets so the uri you wish to redirect to is first or some such, but if this method could go to any one of a number of uris it will need parameterisation.
I hope this helps someone root out their 403 gremlin.