is there a way to get folder membership info in a v3 docs list query?

27 views
Skip to first unread message

Shimon Rura

unread,
Dec 9, 2010, 4:27:04 PM12/9/10
to Google Documents List API
Hi,

I am working on changing some code that currently uses the Google Docs
List Data API version 2 to version 3, so that I can see uploaded files
of custom types (in addition to the natively-supported formats of
document, spreadsheet, etc.). I've gotten it working mostly as
expected, with one caveat: the v2 responses include containing folders
for each document, but the v3 responses do not. Without that data, I'd
have to query separately for folder contents. This is a drag because
it's been very easy to just use the folder membership data that's
already there, instead of doing separate queries and then reconciling
the data myself.

For example, I have a document that's inside of a folder called "Test
Folder". In v2, I queried the URL
https://docs.google.com/feeds/documents/private/expandAcl?max-results=30&showfolders=true&xoauth_requestor_id=user%mydomain.com
, and I get the following 3 <category> elements under that document:

<ns0:category label="document" scheme="http://schemas.google.com/g/
2005#kind" term="http://schemas.google.com/docs/2007#document"
xmlns:ns0="http://www.w3.org/2005/Atom" />

<ns0:category label="viewed" scheme="http://schemas.google.com/g/2005/
labels" term="http://schemas.google.com/g/2005/labels#viewed"
xmlns:ns0="http://www.w3.org/2005/Atom" />

<ns0:category label="Test Folder" scheme="http://schemas.google.com/
docs/2007/folders/us...@mydomain.com" term="Test Folder"
xmlns:ns0="http://www.w3.org/2005/Atom" />

But when I use API version 3, I query the URL
https://docs.google.com/feeds/default/private/expandAcl/?max-results=50&showfolders=true&xoauth_requestor_id=user%40mydomain.com
, and I get only the first two categories above -- missing the folder
that contains my document.

Looking back at the documentation (for both versions), I didn't find
anything that promises that folder membership would be listed in the
document list feed -- so maybe I was relying on an undocumented or
unsupported feature. But if there is a way to get the same data for my
v3 feed query, that would save me a lot of time.

Thank you,
Shimon Rura

Vic Fryzel

unread,
Dec 9, 2010, 6:25:11 PM12/9/10
to google-docum...@googlegroups.com
Hey Shimon,

For every resource entry, there is indeed a parent designator that links to the parent folder, and its title.  Here's an example:
<link rel="http://schemas.google.com/docs/2007#parent" type="application/atom+xml" href="https://docs.google.com/feeds/default/private/full/folder%3AAds3220shjdhfDJJDH" title="Blog Posts"/>

This is true of both the full and expandAcl feeds.

You can see it in the response in the documentation here:

Thanks,
-Vic

Shimon Rura

unread,
Dec 10, 2010, 10:09:31 AM12/10/10
to Google Documents List API
Excellent! That seems to contain the same information as I was
previously getting from the category element. Thank you very much.

shimon.

On Dec 9, 6:25 pm, Vic Fryzel <vicfry...@google.com> wrote:
> Hey Shimon,
>
> For every resource entry, there is indeed a parent designator that links to
> the parent folder, and its title.  Here's an example:
> <link rel="http://schemas.google.com/docs/2007#parent"
> type="application/atom+xml" href="https://docs.google.com/feeds/default/private/full/folder%3AAds3220sh..."
> title="Blog Posts"/>
>
> This is true of both the full and expandAcl feeds.
>
> You can see it in the response in the documentation here:http://code.google.com/apis/documents/docs/3.0/developers_guide_proto...
>
> Thanks,
> -Vic
>
>
>
>
>
>
>
> On Thu, Dec 9, 2010 at 4:27 PM, Shimon Rura <shi...@rura.org> wrote:
> > Hi,
>
> > I am working on changing some code that currently uses the Google Docs
> > List Data API version 2 to version 3, so that I can see uploaded files
> > of custom types (in addition to the natively-supported formats of
> > document, spreadsheet, etc.). I've gotten it working mostly as
> > expected, with one caveat: the v2 responses include containing folders
> > for each document, but the v3 responses do not. Without that data, I'd
> > have to query separately for folder contents. This is a drag because
> > it's been very easy to just use the folder membership data that's
> > already there, instead of doing separate queries and then reconciling
> > the data myself.
>
> > For example, I have a document that's inside of a folder called "Test
> > Folder". In v2, I queried the URL
>
> >https://docs.google.com/feeds/documents/private/expandAcl?max-results...
> > , and I get the following 3 <category> elements under that document:
>
> > <ns0:category label="document" scheme="http://schemas.google.com/g/
> > 2005#kind" term="http://schemas.google.com/docs/2007#document"
> > xmlns:ns0="http://www.w3.org/2005/Atom" />
>
> > <ns0:category label="viewed" scheme="http://schemas.google.com/g/2005/
> > labels" term="http://schemas.google.com/g/2005/labels#viewed"
> > xmlns:ns0="http://www.w3.org/2005/Atom" />
>
> > <ns0:category label="Test Folder" scheme="http://schemas.google.com/
> > docs/2007/folders/u...@mydomain.com" term="Test Folder"
> > xmlns:ns0="http://www.w3.org/2005/Atom" />
>
> > But when I use API version 3, I query the URL
>
> >https://docs.google.com/feeds/default/private/expandAcl/?max-results=...
Reply all
Reply to author
Forward
0 new messages