后续条款,寻找行动项

问题描述 投票:1回答:1

我想写一个快速脚本来提醒自己,放在Google驱动器之外的各种google文档上的后续操作项可以从API list()中受益。但是,似乎followup:actionitems搜索查询无法与API一起使用,因为未知搜索项。它返回400错误。

例如,执行此操作:

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">

我缺少什么吗?使用方法不正确吗?还是计划将来使用?

google-drive-api google-docs-api
1个回答
0
投票

q参数非常好,它使您可以在Google驱动器中搜索文件和目录。但是,它不允许您搜索文件的所有属性。据我了解,后续行动项目不是其中之一。

Documentation

据我所知,Google docs api没有用于搜索文件内容的q参数。

真的,我认为followup:actionitems超出了Google驱动器api的范围,它只是一个文件存储api,它无法跟踪您在Google驱动器Web应用程序中设置的任何设置。正如您从file.resource对象中看到的那样,它甚至在Google驱动器api中的文件上都没有正确显示

© www.soinside.com 2019 - 2024. All rights reserved.