![](/img/trans.png)
[英]After updating file on google drive through google api, the file on local machine is not editable without closing IDLE window
[英]Set Google Doc to shared and editable by everyone with the link through Google Drive API
I'm not sure how to accomplish this in Python - I've understood how to create a Google Doc using the docs API, but I'm struggling on understanding the Drive API and how to use it with Python.
文档清楚地表明我必须在某处插入带有“编辑器”和“所有人”的权限,但我不确定实际代码应该是什么。 有什么帮助吗?
之后,为了模拟您想要的请求,您可以使用Try this API工具。
为了更新文件的权限,请求必须类似于以下内容:
要求
PATCH https://www.googleapis.com/drive/v3/files/fileId/permissions/permissionId
身体
{
"kind": "drive#permission",
"role": "YOUR_ROLE"
}
至于在 Python 中应用此功能,您可以轻松地更新和调整快速入门中的代码,使其符合您的要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.