problem retrieving all documents form api

6 views
Skip to first unread message

paul william ford

unread,
Jan 31, 2012, 12:19:33 AM1/31/12
to google-app...@googlegroups.com
my current code is as follows and returns only 100 rows instead of over 1000+ documents. Thoughts???

 GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
 oauthParameters.setOAuthConsumerKey(sourceConsumerKey);
 oauthParameters.setOAuthConsumerSecret(sourceConsumerSecret);  
 oauthParameters.setOAuthToken(sourceAccessToken);
 oauthParameters.setOAuthTokenSecret(sourceAccessTokenSecret);

 DocsService client = new DocsService("mwp-gaemigration-v1");
 try 
  {
 client.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
} catch (OAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

 DocumentListFeed resultFeed = client.getFeed(feedUrl, DocumentListFeed.class);
 int i=1;
 for (DocumentListEntry entry : resultFeed.getEntries()) {
   System.out.println("#" + i + " " + entry.getTitle().getPlainText() + " " + entry.getFilename() + " " + entry.getResourceId());
   i++;
 }

thanks 

paul

Claudio Cherubino

unread,
Jan 31, 2012, 4:50:14 PM1/31/12
to google-app...@googlegroups.com
Hi Paul,

Each call to getFeed() returns a page of up to 100 results, so you have to paginate through the results as documented at:


Please note that this forum is for questions related to the Domain Management APIs, if you need help with the DocumentsList API you should try with the dedicated forum:


Thanks
Claudio


paul

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/M1bj1AOdRnoJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply all
Reply to author
Forward
0 new messages