Sharepoint/Sharepoint Online: How can I create ChangeToken without using MSFT libraries?
-
08-12-2020 - |
Question
I'm looking for a way to create SP.CHANETOKEN without using MSFT Sharepoint libraries (dlls) Suppose I have the following information available. How can I use the Site ID, and the Time to obtain a changetoken value?
{u'WebId': u'efb506c9-761e-4178-ac03-4903a358e2a6', u'ListId': u'799bdaf0-5e11-40c6-a933-0d335025995f', u'SiteId': u'190b1248-8c70-4279-a638-842065663333', u'Time': u'2016-09-15T09:01:19Z'}
Solution
Changetoken is a semicolon delimited string, and takes the following parameters in the order listed:
- Version number.
- The change scope (0 - Content Database, 1 - site collection, 2 - site, 3 - list).
- GUID of the item the scope applies to (for example, GUID of the list). In my case it was efb506c9-761e-4178-ac03-4903a358e2a6 because I was trying to get changes on the WEB level.
- Time (in UTC) from when changes occurred. This one is a bit tricky, you'll need to provide the ticks count since .NET minvalue.
- Change item on the ChangeToken (you may provide a default value for this > -1)
Sample change token
1;2;efb506c9-761e-4178-ac03-4903a358e2a6;636100287540000000;-1
Following links explain it with sample code.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange