I'm following the Quickstart
on https://developers.google.com/drive/api/v3/quickstart/python. I've enabled the drive API through the page, loaded the credentials.json and can successfully list files in my google drive. However when I wanted to download a file, I got the message
`The user has not granted the app ####### read access to the file`
Do I need to do more than putting that scope in my code or do I need to activate something else?
SCOPES = 'https://www.googleapis.com/auth/drive.file'
client.flow_from_clientsecrets('credentials.json', SCOPES)
Go to the Security section of your Google Account. Under “Third-party apps with account access,” select Manage third-party access. Select the app or service you want to review.
Resolve a 403 error: Project rate limit exceededRaise the per-user quota in the Google Cloud project. For more information, request a quota increase. Batch requests to make fewer API calls. Use exponential backoff to retry the request.
Once you go through the Quick-Start Tutorial
initially the Scope is given as:
SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly'
So after listing files and you decide to download, it won't work as you need to generate the the token again, so changing scope won't recreate or prompt you for the 'google authoriziation' which happens on first run.
To force generate the token, just delete your curent token or use a new file to store your key from the storage:
store = file.Storage('tokenWrite.json')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With