List publicly shared files from google drive using service account key not getting public files

戏子无情 提交于 2019-12-06 13:40:53

A service account is not you it is a dummy user. As like any user a files.list will only return the files that it has access to. That being files it has created and files someone has shared with it. While one would think that public files everyone has access to. If a files.list returned a list of all the files on Google drive that were set to public that would be a huge list and not very useful.

By setting a file to public if you have the file id you will be able to see it using an API key. You wont be able to edit it but you will be able to do a file.get on it.

Take the service account email address and go to google drive share the folder that contains the files with the service account like you would any other user. You can also share each file individually with the service account if you wish. Then try and do a files.list.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!