Google Drive API through Google App Engine

707 views
Skip to first unread message

Luca Matteis

unread,
Oct 4, 2012, 7:42:40 AM10/4/12
to google-a...@googlegroups.com
I'm trying to use the Google Drive API through the App Identity interface provided with Google App Engine. This basically allows my web application to communicate with Google's APIs from server to server.

However, after I set all the appropriate values and scopes, and enable all the right Google Drive knobs on the API console page, I still get this for a simple GET request to https://www.googleapis.com/drive/v2/files:

{ "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." }}

And this is the code - never mind the weird JS syntax, this is still using the Java API:

var scopes = new java.util.ArrayList();
scopes
.add("https://www.googleapis.com/auth/drive");
var appIdentity = AppIdentityServiceFactory.getAppIdentityService();
var accessToken = appIdentity.getAccessToken(scopes);
var url = new URL("https://www.googleapis.com/drive/v2/files");
var connection = url.openConnection();
connection
.setDoOutput(true);
connection
.setRequestMethod("GET");
connection
.addRequestProperty("Content-Type", "application/json");
connection
.addRequestProperty("Authorization", "OAuth " + accessToken.getAccessToken());

Funny thing is that if I simply change the API to use the urlshortner API instead, it works:


And output:

{ "kind": "urlshortener#urlHistory", "totalItems": 0, "itemsPerPage": 30}

What am I missing?

alex

unread,
Oct 29, 2012, 4:49:16 PM10/29/12
to google-a...@googlegroups.com
I think this might help:
http://www.youtube.com/watch?v=iK14bfd6qhs

-- alex
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/v2la6ZNMAsMJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
Reply all
Reply to author
Forward
0 new messages