如何在Microsoft SharePoint 2013中使用GetChanges API监控文件文件夹变更?
Hey there, let's dive into your issue with the SharePoint GetChanges API. First, here's a clear breakdown of what you've shared about your setup and request:
Background
You've added folders and files to the Shared Documents library in SharePoint, and you're trying to pull change records using the GetChanges endpoint.
Your Full Request Details
Request URL
POST https://xxxx.sharepoint.com/_api/web/getchanges?$filter=(Time ge datetime'2018-04-03T09:24:17Z')
Request Body
{"query":{"__metadata":{"type":"SP.ChangeQuery"},"Add":true,"Web":true,"Site":true,"Update": true, "DeleteObject":true, "File":true, "Folder":true, "ContentType":true}}
Partial Response Received
You mentioned you only received an incomplete response starting with:
{ [ "odata.type...
Common Fixes & Troubleshooting Steps
Let's walk through the most likely reasons for this partial response and how to address them:
- Handle pagination: SharePoint's GetChanges API returns results in pages by default. If there are multiple changes, you'll need to use the
ChangeTokenfrom the response'sd.__nextproperty to fetch subsequent pages of results. - Narrow your ChangeQuery: Your current query includes
Web,Site, andContentTypeflags, which might be pulling in unrelated system-level changes. Since you're targetingShared Documents, try trimming the query to only include flags relevant to library content:File,Folder,Add,Update,DeleteObject, andList(to focus on library-specific changes). - Validate the time filter: While your ISO 8601 time format is correct, double-check that the timestamp aligns with your site's time zone settings—mismatches can lead to unexpected result sets.
- Check permissions: Ensure your user or app has at least
Readpermissions on both the site and theShared Documentslibrary; insufficient permissions can cause truncated or incomplete responses. - Capture the full response: Use tools like Postman or Fiddler to capture the complete API response. Sometimes client-side truncation makes it look like the API sent incomplete data, when it's actually just the display cutting off.
Example Modified Query
If you want to focus strictly on document library changes, adjust your request body to this:
{"query":{"__metadata":{"type":"SP.ChangeQuery"},"Add":true,"Update": true, "DeleteObject":true, "File":true, "Folder":true, "List":true}}
内容的提问来源于stack exchange,提问作者Joe
相关产品推荐
相关产品推荐

