ken5scal
ken5scal

Reputation: 37

Listing or getting permissions assigned to the folders under Shared Drive

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 and 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

Answers (1)

Rafa Guillermo
Rafa Guillermo

Reputation: 15375

Answer:

You need to make your request with useDomainAdminAccess set to false and supportsAllDrives set to true.

Example Request:

GET https://www.googleapis.com/drive/v3/files/[FILE_ID]/permissions?supportsAllDrives=true&key=[YOUR_API_KEY] 

Upvotes: 1

Related Questions