簡體   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