Search code examples
google-apigoogle-drive-apigoogle-oauthgoogle-workspace

G Suite Drive API: Why can't I get the permissions of a specific file?


I am consuming data from the G Suite Drive API and I am getting the following error:

[2020-05-09 05:42:33,626: INFO/ForkPoolWorker-1] URL being requested: GET https://www.googleapis.com/drive/v3/files/<FILE_ID>/permissions?fields=%2A&alt=json
[2020-05-09 05:42:34,089: WARNING/ForkPoolWorker-1] Encountered 403 Forbidden with reason "insufficientFilePermissions"
[2020-05-09 05:42:34,089: WARNING/ForkPoolWorker-1] drive#permission: HTTP error (code 403): The user does not have sufficient permissions for this file.

The file causing the trouble is a JPEG. I have both the file ID and the file name.

The situation is as follows:

  • When looking for the file using the Drive Files API and providing the file ID a 200 HTTP response is returned.
  • When looking for the file permissions using the Drive Permissions API, a 403 HTTP error is raised.
  • When looking for the file using the Drive search bar and providing the file name, nothing is found.

Can anyone shed light on this?

Thank you for your time.


Solution

  • If your permissions allow you to use Files: get but not Permissions: list, you have only View Access to a file

    You need to be an editor or owner to use Permissions:list