how to list files shared with me

1,556 views
Skip to first unread message

Dan Schwartz

unread,
Oct 29, 2015, 11:56:35 AM10/29/15
to Google Apps Manager

Is there a query in GAM to "show filelist" the files which are shared with me but which I'm not the owner of.  To duplicate the "shared with me" link on the drive page. 

-Dan

Andy Reynolds

unread,
Sep 29, 2016, 7:17:32 AM9/29/16
to Google Apps Manager
Hi Dan, 

I personally have the very same question. If it is possible to sent a request [most probably using Drive APIv2(v3) with a GET request through GAM] that will show all the files, shared with me. 

+Jay, it will be much appreciated if there is a way. 

Cheers,

Andy 

Ross Scroggs

unread,
Sep 29, 2016, 11:38:39 AM9/29/16
to google-ap...@googlegroups.com
Andy/Dan,

You can get what your want (some effort required).
gam show filelist initializes the query to "'me' in owners"
When you put query "xxx" on the command line, gam appends "and xxx" to the query.
Example: gam user testuser show filelist query "sharedWithMe=True" results in a query of "'me' in owners and sharedWithMe=True"
The result, all the files testuser has shared with itself. To get all files shared with testuser, we've got to negate the initial "'me' in owners".
Solution: gam user testuser show filelist query "sharedWithMe=True or not 'me' in owners"
The result, all files shared with testuser regardless of owner.
But Dan wanted all files shred with testuser where testuser is not the owner. I haven't figured that one out, so time to change the code.
I've added (this was initially suggested by another Gam user whose name I'vr forgotten, so thanks to him) a fullquery argument to show filelist.
fullquery lets you specify exactly the query you want.
All files shared with me regardless of ownership: gam user testuser show filelist fullquery "sharedWithMe=True"
Files owned by others shared with me: gam user testuser show filelist fullquery "sharedWithMe=True and not 'me' in owners"
Files owned by me shared with myself: gam user testuser show filelist fullquery "sharedWithMe=True and 'me' in owners"

I've submiited a change to Jay with this change. For now, you can go here: https://github.com/taers232c/GAM/releases
If you get this version and are cuttently on a version earlier than 3.71, be sure to follow the directions about updating scopes.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/755fd99a-9965-40c7-98a5-24769b1835bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages