0
votes

I want to sync my local db with the server. Let's see I have deleted an item from the web and I comes to my mobile app the email should be deleted from mobile also. How I comes to know which emails are deleted.

Base Url:- https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages/delta.

I am trying @odata.nextLink till @odata.deltaLink comes in response, but in response, I am getting only the emails is there, not getting any tag for delete items.

Have referred this:

 https://docs.microsoft.com/en-us/graph/api/message-delta?view=graph-rest-1.0&tabs=http

Can anyone help me with this? Thanks in advance.

2
By "no data for deleted items" do you mean that you do not get additional properties for emails that are marked as deleted or do you mean that you don't get any deleted email in the delta response? - baywet

2 Answers

0
votes

Url:- https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages/delta

Your Response will be

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(message)",
  "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages/delta?$skiptoken=yourToken",
  "value": [
   ...
  ]
}

Then try calling nextLink till deltaLink comes in response. Once the deltaLink came, save the link and change something in your inbox message like delete one message. After deleting the message call saved deltaLink.

You will get your latest changes in response with new deltaLink. For getting further changes you need to call latest deltaLink. In my, case I have stored the deltaLink in shared preference.

Note:- Be sure that you are calling only the latest deltaLink for latest changes.

0
votes

Shakti S.P. Swain is right. You get only changes when you use the deltalink. In case of the deleted message, you get @removed parameter in it.