SharePoint REST API - 同步SharePoint列表项
博客地址:http://blog.csdn.net/FoxDave
本篇只讲REST服务中的GetListItemChangesSinceToken这个东西。何谓同步呢,你也可以理解为增量变化,即给定一个时间,我需要获取从那个时间到现在所有发生变化的列表项。
使用GetListItemChangesSinceToken同步SharePoint列表项
如果你想要在SharePoint和你的Add-in或服务之间同步列表项,可以使用GetListItemChangesSinceToken来达到目的,它跟SharePoint Web服务请求中的List.GetListItemChangesSinceToken是对应的。
在POST请求的body中加入SP.ChangeLogItemQuery对象的属性。该请求会返回ADO行集合的XML,包含了符合查询条件的列表项的更改记录。
示例请求如下:
请求的URL
POST http://server/site/_api/web/Lists/GetByTitle('Announcements')/GetListItemChangesSinceToken
请求的Body
{ 'd' : { 'query': { '__metadata': { 'type': 'SP.ChangeLogItemQuery'}, 'ViewName': '', 'Query': '<Where><Contains><FieldRef Name="Title" /><Value Type='Text'>Te</Value></Contains></Where>','QueryOptions': '<QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><DateInUtc>False</DateInUtc><IncludePermissions>TRUE</IncludePermissions><IncludeAttachmentUrls>FALSE</IncludeAttachmentUrls><Folder>Shared Documents/Test1</Folder></QueryOptions>', 'ChangeToken':'1;3;eee4c6d5-f88a-42c4-8ce1-685122984870;634397182229400000;3710', 'Contains':'<Contains><FieldRef Name="Title"/><Value Type="Text">Testing</Value></Contains>' } }
}
SP.ChangeLogItemQuery对象属性
Property | Description |
---|---|
ListName | A string that contains either the title or the GUID for the list. When querying the UserInfo table, the string contains UserInfo. Using the GUID results in better performance. |
ViewName | A string that contains the GUID for the view, which determines the view to use for the default view attributes represented by the query, viewFields, and rowLimit parameters. If this argument is not supplied, the default view is assumed. If it is supplied, the value of the query, viewFields, or rowLimit parameter overrides the equivalent setting within the view. For example, if the view specified by the viewFields parameter has a row limit of 100 rows but the rowLimit parameter contains a value of 1000, then 1,000 rows are returned in the response. |
Query | A Query element containing the query that determines which records are returned and in what order. |
QueryOptions | An XML fragment in the following form that contains separate nodes for the various properties of the SPQuery object. |
ChangeToken | A string that contains the change token for the request. For a description of the format that is used in this string, see Overview of the Change Log. If null is passed, all items in the list are returned. |
Contains | A Contains element that defines custom filtering for the query. |
SharePoint REST API - 同步SharePoint列表项相关推荐
- MSDN Visual系列:创建Feature扩展SharePoint列表项或文档的操作菜单项
原文:http://msdn2.microsoft.com/en-us/library/bb418731.aspx 在SharePoint中我们可以通过创建一个包含CustomAction元素定义的F ...
- 关于SharePoint中管理列表项权限
现况概述在SharePoint中对于列表的权限默认是只可以控制到列表级别,而对于列表下面的列表项,在SharePoint中是无法进行控制的. 需求概述现在我参与的项目中需要控制一个文档库中的文档.让这 ...
- [sharepoint]rest api文档库文件上传,下载,拷贝,剪切,删除文件,创建文件夹,修改文件夹属性,删除文件夹,获取文档列表...
写在前面 最近对文档库的知识点进行了整理,也就有了这篇文章,当时查找这些接口,并用在实践中,确实废了一些功夫,也为了让更多的人走更少的弯路. 系列文章 sharepoint环境安装过程中几点需要注意的 ...
- SharePoint REST API - 一个请求批量操作
博客地址:http://blog.csdn.net/FoxDave 本篇主要讲解如何应用$batch查询选项来批量执行REST/OData请求,它将多个操作捆绑到一个请求中,可以改进应用程序的性能 ...
- ios调用restful接口_Office 365 iOS SDK-如何调用SharePoint REST API
所有iOS SDK示例均提供了用于访问邮件,日历,ODfB文件的工作代码,但没有一个示例显示如何访问SharePoint列表项.因此,我正在尝试在Swift中进行一个简单的REST调用,但始终出现以下 ...
- SharePoint REST API - 基本操作(一)
博客地址:http://blog.csdn.net/FoxDave 本文讲述如何应用SharePoint的REST接口完成基本的增删查改操作. 使用SharePoint客户端API和REST服务进 ...
- php 访问 sharepoint列表,SharePoint—用REST方式访问列表
REST的定义与作用 在SharePoint 2010中,基本上有如下几种数据访问方式: 服务器端对象模型 LINQ to SharePoint Web Service 客户端对象模型 ADO.NET ...
- SharePoint REST API - REST请求导航的数据结构
博客地址:http://blog.csdn.net/FoxDave 从一个既定的URL获取其他SharePoint资源 当你用SharePoint REST服务进行开发的时候,你经常会从指定的一个 ...
- SharePoint JavaScript API in application pages
前言 最近,在SharePoint 应用程序页中写JavaScript API,进行一些数据交互.其实,很简单的事情却遇到了问题,记录一下,希望能对遇到类似问题的人以帮助. 引用JavaScript ...
最新文章
- ORB-SLAM2从理论到代码实现(五):ORBmatcher.cc程序详解
- 激光雷达选型指南 这2项重要指标却被很多人忽略
- oracle有text字段吗,Oracle Text简介
- cannot resolve symbol ‘R‘ 程序包R不存在
- 确定最小的正整数n,使得n!的结尾恰好有1987个0
- Rocket - tilelink - Atomics
- 线条边框简笔画图片大全_超治愈萌系手帐素材大全 美食旅游花草人物花边都备齐了...
- 物流配送系统设计java,ZigBee物流配送系统设计
- 图论 —— 最短路 —— Bellman-Ford 算法与 SPFA
- python列表套着列表_python 列表套列表去重
- java bitmap取出数据库_bitmap一般如何取出其所表示的数据(以java为例)
- thymeleaf学习
- c语言斐波那契数列递归数组,C语言数据结构学习:递归之斐波那契数列
- 大数据的分析手段有哪几种
- iZotope Neutron 3 Advanced for mac(智能混音插件包)
- python清空list_python怎么清空list
- python3安装pillow后报错没有pillow模块以及没有PIL模块问题解决
- 开源字体 思源黑体 思源宋体 2.001 ttf格式
- 微信小程序详细教程-10分钟完成微信小程序开发部署发布
- Windows XP SP3 升级故障汇总