Reputation: 33
I'm trying to list only entries in the root via the Google Documents API v3.0. Some users have thousands of files, so requesting the full feed over a mobile data connection takes way too long.
Adding a "q='root' in parents" query to a document list request only returns one file, despite the fact that there are many files in my root. This happens in our REST app, and can be replicated with the OAuth2 playground. I've also tried various URL encodings:
https://docs.google.com/feeds/default/private/full?q='root'%20in%20parents
https://docs.google.com/feeds/default/private/full?q=%27root%27+in+parents
https://docs.google.com/feeds/default/private/full?q=%27root%20%20in%20parents
Here is the output of the OAuth2 playground:
Request:
GET /feeds/default/private/full?q='root'%20in%20parents HTTP/1.1
Host: docs.google.com
Gdata-version: 3.0
Content-length: 0
Authorization: OAuth (removed)
Response:
HTTP/1.1 200
Gdata-version: 3.0
Content-length: 4997
Via: HTTP/1.1 GWA
Content-location: https://docs.google.com/feeds/default/private/full?q='root'%20in%20parents
X-content-type-options: nosniff
Etag: W/"AkAMSXcyfit7ImA9WhJWFU4."
Expires: Tue, 21 Aug 2012 08:46:29 GMT
Vary: Accept, X-GData-Authorization, GData-Version
X-google-cache-control: remote-fetch
Server: GSE
Last-modified: Tue, 21 Aug 2012 08:46:28 GMT
X-xss-protection: 1; mode=block
Cache-control: private, max-age=0, must-revalidate, no-transform
Date: Tue, 21 Aug 2012 08:46:29 GMT
X-frame-options: SAMEORIGIN
Content-type: application/atom+xml; charset=UTF-8; type=feed
-content-encoding: gzip
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:docs='http://schemas.google.com/docs/2007' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/"AkAMSXcyfit7ImA9WhJWFU4."'><id>https://docs.google.com/feeds/default/private/full</id><updated>2012-08-21T08:46:28.996Z</updated><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/docs/2007#item' label='item'/><title>Available Documents - [email protected]</title><link rel='alternate' type='text/html' href='https://docs.google.com'/><link rel='http://schemas.google.com/g/2005#resumable-create-media' type='application/atom+xml' href='https://docs.google.com/feeds/upload/create-session/default/private/full'/><link rel='http://schemas.google.com/docs/2007#alt-post' type='application/atom+xml' href='https://docs.google.com/feeds/upload/file/default/private/full'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full'/><link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full/batch'/><link rel='self' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full?q=%27root%27+in+parents'/><author><name>brains.for.rent</name><email>[email protected]</email></author><openSearch:startIndex>1</openSearch:startIndex><entry gd:etag='"WlEQVU5RRCt7ImBk"'><id>https://docs.google.com/feeds/id/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw</id><published>2012-03-25T00:31:20.449Z</published><updated>2012-03-25T00:31:20.449Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-06-26T09:54:47.811Z</app:edited><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/docs/2007#file' label='text/plain'/><category scheme='http://schemas.google.com/g/2005/labels' term='http://schemas.google.com/g/2005/labels#modified-by-me' label='modified-by-me'/><title>_bowie.txt</title><content type='text/plain' src='https://doc-14-28-docs.googleusercontent.com/docs/securesc/jop11jq8q8326onuco763m92b29jcdfk/dh4ie9qrgpm9eub14drrse8ni0fsb4ku/1345536000000/09632875278015879870/09632875278015879870/0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw?h=16653014193614665626&e=download&gd=true'/><link rel='http://schemas.google.com/docs/2007#parent' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full/folder%3A0B4sxUOzToIviNGNKMGZEbENRVUNrZGtNQ1ZqN3BfZw' title='conv'/><link rel='alternate' type='text/html' href='https://docs.google.com/file/d/0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw/edit'/><link rel='http://schemas.google.com/docs/2007#icon' type='image/png' href='https://ssl.gstatic.com/docs/doclist/images/icon_10_text_list.png'/><link rel='http://schemas.google.com/g/2005#resumable-edit-media' type='application/atom+xml' href='https://docs.google.com/feeds/upload/create-session/default/private/full/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw'/><link rel='http://schemas.google.com/docs/2007#alt-edit-media' type='application/atom+xml' href='https://docs.google.com/feeds/upload/file/default/private/full/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw'/><link rel='self' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw'/><link rel='edit' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw'/><link rel='edit-media' type='text/plain' href='https://docs.google.com/feeds/default/media/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw'/><author><name>brains.for.rent</name><email>[email protected]</email></author><gd:resourceId>file:0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw</gd:resourceId><docs:modifiedByMeDate>2012-03-25T00:31:20.443Z</docs:modifiedByMeDate><gd:lastModifiedBy><name>brains.for.rent</name><email>[email protected]</email></gd:lastModifiedBy><gd:quotaBytesUsed>353894</gd:quotaBytesUsed><docs:writersCanInvite value='false'/><docs:md5Checksum>d9fb3e201d3dcc724d5ed5d05cf27b98</docs:md5Checksum><docs:filename>_bowie.txt</docs:filename><docs:suggestedFilename>_bowie.txt</docs:suggestedFilename><docs:size>353894</docs:size><gd:feedLink rel='http://schemas.google.com/acl/2007#accessControlList' href='https://docs.google.com/feeds/default/private/full/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw/acl'/><gd:feedLink rel='http://schemas.google.com/docs/2007/revisions' href='https://docs.google.com/feeds/default/private/full/file%3A0B4sxUOzToIviLUJGRkJ0VkJSTktQWTNHdWVST2gtdw/revisions'/></entry></feed>
Upvotes: 1
Views: 609
Reputation: 36
Have you tried to return the contents of this collection?
https://docs.google.com/feeds/default/private/full/folder%3Aroot/content
The V3 DocList API has this to say about it:
If you're looking for things that are only in the root collection, an easier way to find them is to make the following query...
-Mike
Upvotes: 1