I’m using google service account to interact with google drive – reading files and folders etc. It works fine but i can’t retrieve labels. Even if i specifically require labelInfo
in fields, it’s never returned back (key is not in the response). With fields="files(*)"
there are canReadLabels
and canModifyLabels
so it has some sort of idea about labels.
After long frustration I tried calling labels api directly using this resource https://developers.google.com/drive/labels/quickstart/python
Few things to note:
- Label does exist in google drive
- File i’m working with has badged label attached to it
- Service account has access to “Drive Labels API” and “Google Drive API”
- Google service account has been granted domain wide delegation for following scopes:
- https://www.googleapis.com/auth/drive.labels.readonly
- https://www.googleapis.com/auth/drive.readonly
- https://www.googleapis.com/auth/drive.metadata.readonly
I can see “Drive Labels API” metrics and it shows API being called with 100% failure rate. Error i’m getting back is the following:
An error occurred: <HttpError 403 when requesting https://drivelabels.googleapis.com/v2/labels?alt=json returned "The user doesn't have permission to perform the requested operation.". Details: "The user doesn't have permission to perform the requested operation.">
What permission is missing?
Gabrielius Krunkauskas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.