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.
The documentation makes it clear that I have to insert a permission with 'editor' and 'everyone' somewhere, but I'm not sure what the actual code should be. Any help?
Afterwards, in order to simulate the request you want, you can make use of the Try this API tool.
So as to update the permissions of a file, the request will have to look something similar to this:
Request
PATCH https://www.googleapis.com/drive/v3/files/fileId/permissions/permissionId
Body
{
"kind": "drive#permission",
"role": "YOUR_ROLE"
}
As for applying this in Python, you can easily update and adapt the code from the quickstart such that it fits your requirements.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.