SharePoint Rest API: GetListItemChangesSinceToken

Saurabh Gangwal 0 Reputation points

I'm trying to fetch file changes that happens under given folder path in SharePoint document library. I'm using below call

POST https://{domain}/sites/{siteName}/_api/web/lists/getbytitle('Drive')/GetListItemChangesSinceToken

JSON payload to request is

    "query": {
        "ViewName": "",
        "QueryOptions": "<QueryOptions><Folder>Drive/Audit Test</Folder></QueryOptions>",
        "ChangeToken": "1;3;b39abb17-7a24-4e9a-8a6e-a75b22bffd11;638306253560530000;905277314"

In response, I get below XML.

<?xml version="1.0" encoding="utf-8" ?><GetListItemChangesSinceTokenResult><listitems MinTimeBetweenSyncs='0' RecommendedTimeBetweenSyncs='180' MaxBulkDocumentSyncSize='500' MaxRecommendedEmbeddedFileSize='500' EffectivePermMask='ViewListItems, OpenItems, ViewVersions, ViewFormPages, Open, ViewPages, ViewUsageData, BrowseUserInfo, UseClientIntegration, UseRemoteAPIs, OpenWebOnly, ViewItemsRequiresOpen' xmlns:s=''
<Changes LastChangeToken="1;3;b39abb17-7a24-4e9a-8a6e-a75b22bffd11;638306269242700000;905285618">
<Id ChangeType="Restore" UniqueId="{F856392A-5F48-471F-BD2A-ADECECBD4EF1}">10</Id>
<Id ChangeType="Restore" UniqueId="{F856392A-5F48-471F-BD2A-ADECECBD4EF1}">10</Id>
<Id ChangeType="Rename" UniqueId="{F856392A-5F48-471F-BD2A-ADECECBD4EF1}">10</Id>
<Id ChangeType="Rename" UniqueId="{F856392A-5F48-471F-BD2A-ADECECBD4EF1}">10</Id>
<Id ChangeType="Rename" UniqueId="{3141DD47-B316-472D-9B45-CF1F63E4DE93}">9</Id>
<Id ChangeType="Delete" UniqueId="{F856392A-5F48-471F-BD2A-ADECECBD4EF1}">10</Id>
<Id ChangeType="Delete" UniqueId="{3141DD47-B316-472D-9B45-CF1F63E4DE93}">9</Id>
<rs:data ItemCount="1">
   <z:row  />

As you can see it returns ChangeType for a file or a folder.


  1. How to get response in JSON, instead of XML format. I did set HTTP request header to Accept: "application/json" but it didn't worked .
  2. File or Folder Move events
    I moved one file from source folder to destination folder. When I check the changes under source folder I saw one rename event and one delete event for that file. see above response for UniqueId="{3141DD47-B316-472D-9B45-CF1F63E4DE93}. Isn't there concrete move type. Something like ChangeType="Move". Also I want to know source and destination location of moved file or folder. Is this possible?
  3. Changes only displays file/folder UniqueId and ChangeType. Is it possible to fetch event timestamp as well?
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
8,129 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,278 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChengFeng - MSFT 3,840 Reputation points Microsoft Vendor

    Hi @Saurabh Gangwal

    For the first question:

    Please try adding this to your title:

    Accept: "application/json;odata=verbose"
    Content type: "application/json"

    For the second question

    To get file or folder move events, you need to use the GetChanges method instead of the GetListItemChangesSinceToken method. The GetChanges method returns a collection of SP.Change objects that represent changes to a list or library.

    For the third question

    You need to use the SP.Change object's Time property. This property returns a date and time value specifying when the change occurred

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng