更改/监视API不能限于单个驱动器吗?

时间:2019-01-04 21:30:39

标签: c# google-api google-drive-api google-oauth google-api-dotnet-client

我正在尝试将我的应用程序设置为在对用户的驱动器进行更改时接收Webhook调用。当前代码如下:

        var service = GetDriveService("myemail@example.com");

        var channel = new Google.Apis.Drive.v3.Data.Channel
        {
            Id = Guid.NewGuid().ToString(),
            Address = "https://myapplication.com/notifications",
            Type = "web_hook",
            Token = "mypersonaldrive"
        };

        ChangesResource.WatchRequest req = service.Changes.Watch(channel, "920");

        req.SupportsTeamDrives = false;
        req.IncludeTeamDriveItems = false;
        req.RestrictToMyDrive = true;

        var newChannel = await req.ExecuteAsync();

已创建频道,但是即使用户在团队合作中,我的用户进行的每一次更改都会通知应用程序。鉴于我将其限制在驱动器中,我不应该只接收驱动器中实际文件更改的回调吗?

关于如何进行这项工作的任何建议吗?

在通知中,ResourceUri为:

[X-Goog-Resource-URI, https://www.googleapis.com/drive/v3/changes?includeCorpusRemovals=false&includeRemoved=true&includeTeamDriveItems=false&pageSize=100&pageToken=920&restrictToMyDrive=true&spaces=drive&supportsTeamDrives=false&alt=json]

我应该如何知道该用户的实际更改?

0 个答案:

没有答案