Access Google Drive API Returns Empty File List

后端 未结 3 1685
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 14:39

I\'m testing out the Google Drive API. The test script does the HTTP GET to access the Files->List API but somehow I always get an empty list in items. I have hundreds of fi

3条回答
  •  执笔经年
    2020-12-20 15:09

    This usually means you've authenticated with a scope that doesn't give you permission to see those files.

    For example, the scope https://www.googleapis.com/auth/drive.file only provides access to files created or opened by the app. You won't be able to access files created in the Google Drive interface or by other apps.

    If you want to access all the files, you'll have to use another scope. https://www.googleapis.com/auth/drive, for example, gives you full, permissive scope to access all of a user's files.

    You can find information about the available scopes here. Use it to pick the right scope for your app.

提交回复
热议问题