[英]Can I create a Google Drive folder using service account with Python?
I can create a folder using account Owner but cannot share it with service account.我可以使用帐户所有者创建文件夹,但不能与服务帐户共享。
Is there a way for My Python script to create a folder using service account and then upload a file?我的 Python 脚本有没有办法使用服务帐户创建文件夹然后上传文件?
You can create a folder and upload file, same process flow as a real user when you using a service account.您可以创建文件夹并上传文件,使用服务帐户时与真实用户相同的流程。
As stated in this blog , you have to remember that:如本博客所述,您必须记住:
A service account is a sort of virtual user or robot account associated with a given project.
服务帐户是一种与给定项目关联的虚拟用户或机器人帐户。 It has an email address, and a cryptographic key pair.
它有一个电子邮件地址和一个加密密钥对。
Also, there is a statement from a related SO question that:此外,还有来自相关SO 问题的声明:
There is no UI for Service Accounts.
服务帐户没有 UI。 The files are only accessible to your app.
这些文件只能由您的应用访问。
I suggest that you share a folder from a real account to your service account so that accessing the files would be easier.我建议您将真实帐户中的文件夹共享到您的服务帐户,以便更轻松地访问文件。
Hope this help!希望这有帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.