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