0
votes

We know this request below will return your current contacts from Outlook ..

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

but what if I want to get a Group of contacts (the folder where I collect my contacts). What should the request look like? I search in Microsoft docs. I didn't find anything or maybe I searched in wrong place. Any another possibilities to get contacts even over another apis such (outlook-rest-api).

What I did but that not my attention:

code below over graph sdk to retrieve 1000 contacts:

var contacts = await graphClient.Me.Contacts.Request().Top(1000).GetAsync();

Is there something like that ?

var GroupOfcontacts = await graphClient.Me.GroupContacts.Request().GetAsync();
1

1 Answers

0
votes

Actually i saw this in Microsoft Docs

https://docs.microsoft.com/en-us/graph/api/user-list-contactfolders

i got contacts inside that folder thank folderid, which i can get it through iterating over Contactfolders property like that :

var contactFolders = await graphClient.Me.ContactFolders.Request().GetAsync();

foreach (folder in contactFolders) {

    var folderContacts = await            
      graphClient.Me.ContactFolders[folder.Id].Contacts.Request().GetAsync();
}