![](/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.