1
votes

We are building an application that integrates office 365 using graph APIs. We need to pull all the office 365 contacts into our system and needs to be in sync. There is delta API in office to pull only delta changes. We found an issue like we can not pull extended properties(Which includes outlook MPAI fields like mobile phone, assistant phone, etc)

GET https://graph.microsoft.com/v1.0/me/contacts/delta

So office 365 expects the client to make extra API call to get extended properties for each contact? Means if the user has 1000 contacts, the client has to make 1000 plus API calls to pull the contacts from office365?

There is another contact search API which supports extended properties in a single call. Can we use this to pull the delta changes?

GET https://graph.microsoft.com/v1.0/me/contacts?$filter=lastModifiedDateTime gt  '2018-07-28T05:25:32Z'

Please advice us how we can effectively pull office365 contacts

Thanks in advance!

1

1 Answers

2
votes

As far as i can see (and observed myself with calendar events) expand is not supported for most delta query calls. See doc for delta query under Optional Query Parameters:

$expand is only suported for the manager and members navigational property for users and groups respectively.

Your filter request is also not supported for delta query. If u use :

GET https://graph.microsoft.com/v1.0/me/contacts/delta?$filter=lastModifiedDateTime gt  2018-07-28T05:25:32Z

You get the following error:

"error":
{
    "code": "ErrorInvalidUrlQuery",
    "message": "The following parameters are not supported with change tracking over the 'Contacts' resource: '$orderby, $filter, $select, $expand, $search, $top'.",
    "innerError":
    {
        "request-id": "da1174b3-d...",
        "date": "2018-08-06T12:45:34"
    }
}

Funnily enough select is actually supported (contact delta doc). Any way it seems like your only choice is to expand the normal contact request for a user. If there are a lot of changes, you could try batching the expanded contact requests.