I'm trying to familiarize myself with the Google Drive API using the official Java sample. However, after spending several hours trying to install the sample twice, I still cannot use it as expected.
Instead of displaying the contents of the file, it throws a 404 error in the FileServlet (path / svc). In particular, service.files().get(fileId).execute(); seems to return null. I tried it with different files, different MIME types, directly from Google Drive, and also using File File Picker.
I followed the steps as described in https://developers.google.com/drive/examples/java as close as possible.
Has anyone been able to get a sample?
change Here the output of the FileServlet log when requesting URL /svc?file_id=0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw (error 404 is selected on line 78):
2012-04-26 08:21:36.077 com.google.api.client.http.HttpRequest execute: -------------- REQUEST -------------- GET https://www.googleapis.com/drive/v1/files/0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw Accept-Encoding: gzip User-Agent: Google-HTTP-Java-Client/1.8.3-beta (gzip) D 2012-04-26 08:21:36.263 com.google.api.client.http.HttpResponse <init>: -------------- RESPONSE -------------- 403 OK content-type: application/json; charset=UTF-8 content-encoding: gzip date: Thu date: 26 Apr 2012 06:21:36 GMT expires: Thu expires: 26 Apr 2012 06:21:36 GMT cache-control: private cache-control: max-age=0 x-content-type-options: nosniff x-frame-options: SAMEORIGIN x-xss-protection: 1; mode=block content-length: 188 server: GSE x-google-cache-control: remote-fetch via: HTTP/1.1 GWA D 2012-04-26 08:21:36.265 com.google.api.client.http.HttpResponse getContent: Response size: 188 bytes D 2012-04-26 08:21:36.271 com.google.api.client.http.HttpResponse getContent: { "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" } }
It sounds just like “I don't know you,” so I looked again at my client identifier and client secrets: I noticed that the identifier has two client identifiers and client API secrets, one “Client identifier for web applications” and another "Client ID for the SDK drive." I previously used one for web applications, so I tried switching to one for the SDK drive. Unfortunately, this does not change anything. Same error ...: /
Tomtasche
source share