Tuesday, 18 July 2017

Get Version History Details From share point document Library using Rest api


Using rest api :
site URL+"/_api/web/lists/get by title (List Name)/items$expand=File/Versions",


  • if we use up to (/_api/web/lists/get by title(List Name)/items) it gives all the details from list/library
  • If You want all details about particular document we need to use Expand query using expand key word
  • In side file versions available so that need to expand versions.

site URL    : Its site url .
List Name  : share-point list/library name.

Using Ajax with Rest api:

$.ajax(
{
url:site URL+"/_api/web/lists/get by title(List Name)/items$expand=File/Versions,"
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
},
success: function (data) {
Success(data.d.results);
},
error: function (data) {
}    
});
}

No comments:

Post a Comment

How to get the value from web.config(if any value assign as static Key)

Web.Config File:   <appSettings>     <add key="DomainName" value="PW" />     </appSettings> Cl...