繁体   English   中英

通过 Google Drive API 将 Google Doc 设置为可供所有人共享和编辑

[英]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.

文档清楚地表明我必须在某处插入带有“编辑器”和“所有人”的权限,但我不确定实际代码应该是什么。 有什么帮助吗?

我建议您首先在此处查看带有 Python 的 Drive API 快速入门。

之后,为了模拟您想要的请求,您可以使用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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM