HongYiLin
HongYiLin

Reputation: 13

How to list the deleted contacts by Microsoft Graph API

I want to do a sync action in my client side, so need to know how to get all deleted contact list.

By the api (GET /me/contacts), I could get all contact list But it wastes much time when the user has large contacts.

This api (GET /me/contacts/{id}) tell us the contact is exist or not.
it is inefficient to check every contacts are deleted or not for me.

Which apis do I use? thanks for your help.

Upvotes: 0

Views: 827

Answers (2)

Jason Johnston
Jason Johnston

Reputation: 17702

Why not use the delta query preview in the /beta endpoint? That should do what you want.

Upvotes: 2

spery
spery

Reputation: 342

More efficient way for you to check which contacts were removed is getting just the list of contact ID's and then doing the diff between list of ID's returned by graph, and local list.

You can use query parameters to retrieve just the ID's of the contacts, instead of getting the whole objects.

Method url: https://graph.microsoft.com/v1.0/me/contacts?$select=id

Upvotes: 0

Related Questions