使用REST API检索特定版本文件的元数据 [英] Retrieve metadata of a specific version of a file using REST API's

查看:81
本文介绍了使用REST API检索特定版本文件的元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我需要从sharepoint检索特定文档版本的元数据 使用其余的API。

I have a requirement to retrieve metadata of a specific document version from sharepoint  using its rest API.

我能够检索最新版本的元数据 

I was able to retrieve metadata of the latest version 



HTTP://主机名/网站/合同/ _api /网络/ GetFolderByServerRelativeUrl( '合同/ ZZ%20Contract%20-%20Nonconfidential')/文件( 'Test3.docx')/属性

我还能够下载文件的特定版本 

I was also able to download the specific version of the document 



http:// hostname / sites / contracts / _api / web / GetFolderByServerRelativePath(encodedurl ='/ sites / contracts / Contracts / ZZ%20Contract% 20%20Nonconfidential')/ Files('Test5.docx')/版本(1024)/ $ value

推荐答案

对于SharePoint Online,

新的SharePoint CSOM版本已经发布
。我们可以使用这个最新的CSOM版本访问以前版本的字段值。

For SharePoint Online, new SharePoint CSOM version has released. We can access field values of the previous version With this latest CSOM release.

但是,此在线CSOM版本不能在本地环境中使用。对于SharePoint内部部署,REST API或CSOM中没有此类方法来获取版本
当前项目字段的信息,

作为解决方法,我们可以使用

lists.asmx GetVersionCollection方法
.Lists.asmx中没有这样的功能可以帮助我们批量获取所有字段的所有版本,因此我们可能需要逐个遍历所有想要的字段。

As a workaround, we can get version information for a specific field using the lists.asmx GetVersionCollection method. There is no such function in the Lists.asmx can help us to get all the versions of all fields in a batch, so we might need to iterate through all the wanted fields one by one.

另一种方法是,您可以从t
SPFileVersion类

Best  respect,

Linda 张


这篇关于使用REST API检索特定版本文件的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆