我想编写一个快速脚本来提醒自己将后续行动项目放在各种 Google 文档中,而不是 Google Drive 中,以便从 API list() 中受益。但是,followup:actionitems由于搜索词未知,搜索查询似乎无法与 API 配合使用。它返回 400 错误。
followup:actionitems
例如,这样做:
results = service.files().list(q="followup:actionitems", pageSize=50, pageToken=page_token, fields="nextPageToken, files(id, name)").execute()
结果:
Traceback (most recent call last): File "./reminder.py", line 49, in <module> main() File "./reminder.py", line 38, in main fields="nextPageToken, files(id, name)").execute() File "/home/x/.virtualenvs/gdocs-followup-reminder-7WeAWiqi/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper return wrapped(*args, **kwargs) File "/home/x/.virtualenvs/gdocs-followup-reminder-7WeAWiqi/lib/python3.7/site-packages/googleapiclient/http.py", line 856, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/drive/v3/files?q=followup%3Aactionitems&pageSize=50&fields=nextPageToken%2C+files%28id%2C+name%29&alt=json returned "Invalid Value">
我是不是遗漏了什么?用法不对?还是说以后有计划提供此功能?
您可以通过将参数设置q为
q
fullText contains 'followup:actionitems' and trashed = false
返回与 Google Drive UI 相同的文件