如何在MS Sharepoint 2013中使用GetChanges API进行文件夹更改?

时间:2018-04-03 10:53:11

标签: sharepoint sharepoint-2013 sharepoint-online

我已将一些文件夹和文件添加到“共享文档”并尝试阅读获取更改响应。 请查看下面的my / getchanges请求和响应:

POST https://xxxx.sharepoint.com/_api/web/getchanges?$filter=(Time ge datetime'2018-04-03T09:24:17Z')

{"query":{"__metadata":{"type":"SP.ChangeQuery"},"Add":true,"Web":true,"Site":true,"Update": true, "DeleteObject":true, "File":true, "Folder":true, "ContentType":true}}

对于上述请求,我的回答低于:

{  
   [
            "odata.type": "SP.ChangeFile",
            "odata.id": "https://xxxx.sharepoint.com/_api/SP.ChangeFile7f33e785-a5dc-424a-bc31-d953171db7b2",
            "odata.editLink": "SP.ChangeFile7f33e785-a5dc-424a-bc31-d953171db7b2",
            "ChangeToken": {
                "StringValue": "1;2;155cd6ac-2fa5-4fc6-8297-10917724fcdf;636583446482830000;79145543"
            },
            "ChangeType": 1,
            "SiteId": "f6aea202-e4c9-4a16-927d-a222975c592e",
            "Time": "2018-04-03T09:30:48Z",
            "UniqueId": "83746e80-56e7-4b76-9427-6920b0677447",
            "WebId": "155cd6ac-2fa5-4fc6-8297-10917724fcdf"
        },
        {
            "odata.type": "SP.ChangeFolder",
            "odata.id": "https://xxxxxx.sharepoint.com/_api/SP.ChangeFolder202b82c0-4a3a-4b70-879a-8d41b63ced7f",
            "odata.editLink": "SP.ChangeFolder202b82c0-4a3a-4b70-879a-8d41b63ced7f",
            "ChangeToken": {
                "StringValue": "1;2;155cd6ac-2fa5-4fc6-8297-10917724fcdf;636583446489070000;79145549"
            },
            "ChangeType": 2,
            "SiteId": "f6aea202-e4c9-4a16-927d-a222975c592e",
            "Time": "2018-04-03T09:30:49Z",
            "UniqueId": "6847b1e9-169b-4d15-9c3c-0b3b1a9848a8",
            "WebId": "155cd6ac-2fa5-4fc6-8297-10917724fcdf"
        }
    ]
}

我面临以下关于getchanges api的问题:

  1. getchanges API在文件和文件夹的情况下不返回响应中的更改。它正在返回昨天更新的文件和文件夹。 相同的API与List,ListItem等完美配合。

  2. 对于上述回复,我如何检索添加/更新了哪个文件夹或文件,因为我正在回复webid和siteid

  3. 请建议?

0 个答案:

没有答案