Reputation: 1993
I am unable to list files in drive.appdata
scope.
I receive this error:
The granted scopes do not give access to all of the requested spaces.
list
request is accepted by drive.appdata
scope.
Code:
response = self.service.files().list(q="name = 'test.txt'").execute()
Upvotes: 1
Views: 412
Reputation: 4419
You need to search within the appDataFolder
; see docs here.
Adapt your query to include it as a parent to the files which you want to list.
response = self.service.files().list(q="name = 'test.txt' AND 'appDataFolder' in parents").execute()
The query string can remain the same, and set the field spaces
to 'appDataFolder' as suggested in the aforementioned docs.
Upvotes: 1
Reputation: 1993
Adding spaces='appDataFolder'
solved it:
response = self.service.files().list(spaces='appDataFolder',q="name = 'test.txt'").execute()
Upvotes: 2