Is there any client side API available (e.g. -CSOM or Rest) to capture version for a document in SharePoint Online ?
Asked
Active
Viewed 378 times
0
-
Hi @Samik, Though I didn't tried this but Pz look into this: http://yadavnitinkumar.blogspot.in/2014/12/adding-new-version-in-version.html. – Anupam Sharma Jul 22 '15 at 06:51
1 Answers
0
You can pull the file versions out using CSOM by asking for the file and its versions. This example pulls the versions out for all files in a given list, but if you have the file reference, you would only need to load its Versions
property.
var collection = list.GetItems(CamlQuery.CreateAllItemsQuery());
clientContext.Load(collection, items => items.Include(
i => i.File,
i => i.File.Versions));
clientContext.ExecuteQuery();
var item = collection.Single();
foreach (var version in item.File.Versions)
{
// Do work here
}

Zach
- 174
- 2
- 7
-
-
Is there a way to obtain the File object for the version variable or the Level of approval property for that version file? – anairinac Sep 04 '15 at 19:55