Convert SyncState(EWS) to Delta(Graph)

Gabriel Roy 21 Reputation points
2022-09-07T18:40:18.007+00:00

Hi!

We are changing from EWS to Graph to read a mailbox.
On EWS we used SyncFolderItems operation, with the SyncState (https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/syncfolderitems-operation)
On Graph we use message, with delta (https://learn.microsoft.com/en-us/graph/api/message-delta?view=graph-rest-1.0&tabs=http)

The problem is converting the SyncState to delta.
When the user calls our service, he gives us the last SyncState he had and we give him back the new one after we called SyncFolderId. Now that we are using Graph, the user syncState is not a valid id for the delta, and we need to know where he was at his last reading.

Is there any way to convert SyncState to delta? We don't want the user to read the same messages twice, or to miss some.

Thanks!

Exchange | Exchange Server | Management
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dan 0 Reputation points
    2025-07-09T14:53:45.54+00:00

    For moving from EWS SyncFolderItems  to Graph Delta Sync - This is what I sent to a customer:

    You could do something like this:

    1. Start a delta sync up to now and don't process any changes.
    2. Do syncfolderitems and process the changes to get current.
    3. Use delta sync and process changes from then on.  The last step would have minimal resyncing of the same data.

    You could also do a delta sync and use the last modified time on each item to see if it’s changed since your last backup. The problem is that that time will change a lot – even when Microsoft backend servicing applications make maintenance changes and if you rely on it then you could end up syncing a LOT more data then you would want (even a full mailbox).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.