Reputation: 37
I am trying to list all permissions assigned to files/folders under the shared drive for the purpose of retrieving external collaborators.
It seems I have proper access right for All the files and folders since I can list/get them via drive API, but when it comes the the permission, the API claims the file/folders do not exist. Is this the known behavior, or there is another way of retrieving permissions from files/folders in the shared drive?
request
GET https://www.googleapis.com/drive/v3/files/[FILE ID]/permissions?useDomainAdminAccess=true&key=[YOUR_API_KEY] HTTP/1.1
response
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "File not found: [FILE ID].",
"locationType": "parameter",
"location": "fileId"
}
],
"code": 404,
"message": "File not found: [FILE ID]."
}
}
Upvotes: 0
Views: 319
Reputation: 15375
You need to make your request with useDomainAdminAccess
set to false
and supportsAllDrives
set to true
.
GET https://www.googleapis.com/drive/v3/files/[FILE_ID]/permissions?supportsAllDrives=true&key=[YOUR_API_KEY]
Upvotes: 1