[Graph API] Accessing ContactFolders outside of "Contacts"

Nucom AG Fabian Zünd 1 Reputation point
2021-04-26T08:42:52.023+00:00

Hello. I'm currently trying to migrate from EWS to Microsoft Graph, to read Contacts, and import them into a Phonebook on our PBX.

I'm Looking for a way to access ContactFolders, which are not childfolders of the default "Contacts" folder of a user.

So in terms of the Exchane Structure its like this:
Inbox
...
Contacts
TestContacts
Private Contacts
...
Sent

Instead of
Inbox
...
Contacts |
__________|-> TestContact
__________|-> Private Contacts
...
Sent

But the contactFolders API Point only returns Childfolders of "Contacts", rather than all ContactFolders which exist in this User.
So i tried to iterate over the WellKnownFolderName.Root with ContactFolders("Root"), but it says it's an invalid id.
Using mailFolders("Root") does work, and i can iterate over everything, but of course it does not return the ContactFolders.

Is there a way to access these ContactFolders, or do i have to tell our customers, that they've to make sure all ContactFolders that need to be acessed have to be moved under "Contacts"?

Sincerely
Fabian

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,645 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nucom AG Fabian Zünd 1 Reputation point
    2021-04-29T11:05:50.293+00:00

    Thanks for that Feedback.

    Yes, i want to access the contacts in a specific folder.
    Where i'm struggling is, how to make it easy for an Enduser to configure this.

    If the enduser needs to find the id of a folder this is gonna be too complicated.
    Since you can't use the contactfolders endpoint for folders outside of the default "contacts" you'd have to use something like mfcmapi, to access the Exchange Structure, navigate to the specific folder, and find the Attribute, which contains the id.

    0 comments No comments