SharePoint / SharePoint/sp-dev-docs
The Sharepoint list getChanges API does not throw exception for expired changeToken.
@Ashlesha-MSFT is already working on this.
Since Sep 3, 2025.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Developer environment
Linux
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
Using the SharePoint API with curl in a UNIX environment
Describe the bug / error
According to the SharePoint Change Log documentation, the change log may be rotated after 60 days.
Additionally, the SharePoint getChanges API documentation states that the API should return an SPInvalidChangeTokenException if the token is invalid.
In our recent testing, when using a changeToken generated more than 60 days ago, the API neither returned changes/events older than 60 days nor threw the expected SPInvalidChangeTokenException.
If this is expected behavior, it implies that some changes/events may be missed when relying on this API to retrieve changes.
Steps to reproduce
- Collect changeToken from a getChanges API response 60 days ago.
- During this period, several list item changes occurred on the same list.
- When calling getChanges API again with this changeToken, the API neither returned the changes from 60 days ago nor threw an exception.
Expected behavior
When calling getChanges API with expired changeToken, the API should throw an exception: SPInvalidChangeTokenException.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.