Search code examples
google-drive-apigoogle-api-ruby-client

Get file list from google drive public folder shared by link via API


I'm trying to create script to download all files from another user shared folder in google drive using rest api. If i'm right, there are two variants:

  1. Using drive.children.list, with folder ID
  2. Using drive.files.list, with search query like 'FOLDER_ID in parents'

But both of this variants returning only files which were once opened by my google account in browser. If I open file in browser - this file will appear in results of API calls.

Folder is shared for anyone, who has link.

Where is the problem, how I can list all files in folder?


Solution

  • Since you did not give us any info about the SCOPE, I am wild-guessing that it may be your problem. You probably have FILE scope, instead of DRIVE.

    Also, I would recommend to test these things with 'TryIt!' here. You can quickly modify both scopes and queries there.

    Good Luck