在 Drive API V3 中列出来自 drive.appdata 范围内的文件时的 insufficientScopes
insufficientScopes when listing files from drive.appdata scope in Drive API V3
我无法列出 drive.appdata
范围内的文件。
我收到此错误:
The granted scopes do not give access to all of the requested spaces.
list
按 drive.appdata
范围请求 is accepted。
代码:
response = self.service.files().list(q="name = 'test.txt'").execute()
您需要在appDataFolder
内搜索; see docs here.
调整您的查询以将其作为您要列出的文件的父项包括在内。
示例:
response = self.service.files().list(q="name = 'test.txt' AND 'appDataFolder' in parents").execute()
更新:
查询字符串可以保持不变,并按照上述文档中的建议将字段 spaces
设置为 'appDataFolder'。
添加 spaces='appDataFolder'
解决了问题:
response = self.service.files().list(spaces='appDataFolder',q="name = 'test.txt'").execute()
我无法列出 drive.appdata
范围内的文件。
我收到此错误:
The granted scopes do not give access to all of the requested spaces.
list
按 drive.appdata
范围请求 is accepted。
代码:
response = self.service.files().list(q="name = 'test.txt'").execute()
您需要在appDataFolder
内搜索; see docs here.
调整您的查询以将其作为您要列出的文件的父项包括在内。
示例:
response = self.service.files().list(q="name = 'test.txt' AND 'appDataFolder' in parents").execute()
更新:
查询字符串可以保持不变,并按照上述文档中的建议将字段 spaces
设置为 'appDataFolder'。
添加 spaces='appDataFolder'
解决了问题:
response = self.service.files().list(spaces='appDataFolder',q="name = 'test.txt'").execute()