none
Outlook REST API sync messages: no deltaLink in last response RRS feed

  • Question

  • I'm using Outlook REST API v2.0, and follow instructions from docs: msdn.microsoft.com/en-us/office/office365/api/mail-rest-operations#synchronize-messages


    Everything goes fine, I send Prefer: odata.track-change header with initial and "delta" requests, receive Preference-Applied: odata.track-changes with initial response (not with "delta" or "next" responses), receive nextLink while there still are messages to sync, but when round is over, docs say I should receive deltaLink, which I can use in following rounds, but I don't receive it.


    Here I print request url, count of received messages and keys of parsed json response:

    <<<< init url: https://outlook.office.com/api/v2.0/users/UserX@myorg.onmicrosoft.com/MailFolders/Inbox/messages
    >> init messages: 100
    >> init keys: [u'@odata.deltaLink', u'@odata.context', u'value']
    
    <<<<<<< https://outlook.office.com/api/v2.0/users/UserX@myorg.onmicrosoft.com/MailFolders/Inbox/messages/?%24deltatoken=x6ACBKs7JAHtb4FNhCplyPMw9QUAAGlsP20BAAAA
    >> messages: 100
    >> response keys: [u'@odata.nextLink', u'@odata.context', u'value']
    
    <<<<<<< https://outlook.office.com/api/v2.0/users/UserX@myorg.onmicrosoft.com/MailFolders/Inbox/messages/?%24skipToken=x6ACAqs7JAHtb4FNhCplyPMw9QUAAGlsP20CAAAA
    >> messages: 100
    >> response keys: [u'@odata.nextLink', u'@odata.context', u'value']
    
    <<<<<<< https://outlook.office.com/api/v2.0/users/UserX@myorg.onmicrosoft.com/MailFolders/Inbox/messages/?%24skipToken=x6ACAqs7JAHtb4FNhCplyPMw9QUAAGlsP20DAAAA
    >> messages: 100
    >> response keys: [u'@odata.nextLink', u'@odata.context', u'value']
    
    <<<<<<< https://outlook.office.com/api/v2.0/users/UserX@myorg.onmicrosoft.com/MailFolders/Inbox/messages/?%24skipToken=x6ACAqs7JAHtb4FNhCplyPMw9QUAAGlsP20EAAAA
    >> messages: 93
    >> response keys: [u'@odata.context', u'value']

    As you can see I also use x-AnchorMailbox impersonation, but it's not explicitly prohibited.


    So, am I doing something wrong, or this API is broken?



    • Edited by gistart Wednesday, July 12, 2017 10:45 PM formatting
    Wednesday, July 12, 2017 10:44 PM

All replies

  • Turned out, despite docs in texts and examples say you don't send Prefer: odata.track-changes header with skipToken requests, you have to do that to receive `deltaToken`.
    Thursday, July 13, 2017 5:00 PM