user3038317
user3038317

Reputation: 41

get google drive folderId javascript

Is there a javascript for getting the public folderId for my local googledrive versus having to manually go to the local googledrive directory and copying the result of the "ViewOnTheWeb" menu option? e.g. result is https://docs.google.com/folderview?id=XXXXXXXXXXXXXXXXXXX

i.e. get the id programmaticaly from a webpage once given the local directory

e.g. C:\Users\Me\Google Drive\Mypublicdirectory

Upvotes: 0

Views: 779

Answers (1)

pinoyyid
pinoyyid

Reputation: 22286

Yes. use the Drive API as described here https://developers.google.com/drive/v2/reference/files.

Specifically you will probably want to use the query parameter on the folder's title.

Two gotchas to watch out for :-

  1. Folder names need not be unique
  2. Items in trash will match by default

So your query would be (in pseudo code) title = 'xxxxxx' and trashed=false and mimeType = application/vnd.google-apps.folder

Upvotes: 1

Related Questions