控制云端硬盘中共享文件夹的活动

发布于 2025-01-16 19:35:59 字数 652 浏览 1 评论 0原文

我想控制 Google 云端硬盘中共享文件夹的活动。

我正在使用 Google Drive Activity API 来查看文件的实时信息,但遇到了两个问题:

  • 我只能看到文件夹中我所做的修改,而看不到其他人所做的修改。 (我想有一些关于 2AuthClient 令牌的信息)

  • 我无法知道文件是否被重命名(目前这并不重要)

我在想也许解决方案是要求每个有权访问该文件夹的帐户创建 Auth2Client 令牌并发给我。之后,为每个发送令牌的人运行一个函数,我看到的问题是共享个人和私有令牌的简单行为,但使用内部相同的代码执行多个函数的事实不是很合乎逻辑。

有没有人遇到过同样的问题并找到解决方案?

我的代码来自 Developers Google 平台:此处

即使在它应该获取 ActorInfo 的代码,它只将作为演员,因为它只看到我的修改,而不是其他修改。

或者,即使有人知道实现此任务的另一种方法(也许没有谷歌驱动器活动 API),这也会非常有帮助。提前致谢!

I would like to control the activity of a shared folder that I have in Google Drive.

I am using the Google Drive Activity API to see the real-time information of the files but I came across two problems:

  • I can only see the modifications in the folder made by me and not by the others. (I suppose there's something about the 2AuthClient token)

  • I can't get to know if a file was renamed or not (which is not that important at the moment)

I was thinking that maybe a solution would be to ask that each account that has access to the folder to create an Auth2Client token and send it to me. After that run a function for each person who sends their token, the problem I see with that is the simple act of sharing a token which is personal and private but also the fact of doing multiple functions with the same code inside is not very logical.

Has anyone faced the same problem and found a solution?

My code is from the Developpers Google platform: here

And even if in the code it's supposed to get the ActorInfo, it only gives me as the actor because it only sees my modifications and not the other modifications.

Or even if someone knows another way to achieve this task (maybe without google drive activity API) it will be very helpfull. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长亭外,古道边 2025-01-23 19:35:59

要向确定的资源显示活动,您必须添加以下参数之一作为联合字段keyitemNameancestorName。如果未指定密钥,则默认值为 ancestorName : items/root

文档

字段
itemName字符串
返回此云端硬盘项目的活动。格式为items/ITEM_ID
祖先名称字符串
返回此云端硬盘文件夹及其所有子文件夹和后代文件夹的活动。格式为items/ITEM_ID

在您的情况下,当您想要查询确定的共享文件夹时,您应该将其添加到请求正文中:

const param = {"ancestorName" : "items/<folder_id>"}
文档:

To show the activities to determined resources you have to add one of the following parameters as a union field key: itemName or ancestorName. The default is ancestorName : items/root if no key is specified

As stated in the documentation:

Fields
itemNamestring
Return activities for this Drive item. The format is items/ITEM_ID.
ancestorNamestring
Return activities for this Drive folder and all children and descendants. The format is items/ITEM_ID.

In your case, as you want to query for a determined shared folder, you should add this inside the Request Body:

const param = {"ancestorName" : "items/<folder_id>"}
Documentation:
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文