【发布时间】:2022-01-20 02:44:21
【问题描述】:
是否可以让谷歌服务帐户访问整个驱动器而不仅仅是文件夹?
我无法在 python 中使用google docs API 切换到新目录。可以跳转到一个文件夹,然后使用google drive APIs 在其中创建文档,但我只想使用docs API,我看不到任何跳转到另一个文件夹的方法。
【问题讨论】:
-
您好,请注意您在这里提出了很多问题。我建议您编辑您的帖子,以便专注于单个特定问题stackoverflow.com/help/how-to-ask
-
当然,我会更新问题。
-
jump into another folder是指将文件移动到其他文件夹?您不能在 Docs API 中执行此操作,您必须为此使用 Drive API。我可以知道您为什么不想使用云端硬盘,而只想使用文档吗? -
我在使用 Drive API 时无法向我的文档添加任何内容。我没有得到任何可以使用驱动器 API 进行批量更新的逻辑。在 docs API 中,它很简单 -
result = service.documents().batchUpdate(documentId=DOCUMENT_ID, body={'requests': requests}).execute() -
当然,
batchUpdate将与 Docs API 一起使用。但是对于文件创建,我建议使用 Drive API,因为您想将其添加到特定文件夹中。请查看我的答案以获取更多信息。
标签: python-3.x google-drive-api google-docs google-docs-api google-api-python-client