question

NucomAGFabianZnd-3089 avatar image
0 Votes"
NucomAGFabianZnd-3089 asked saldana-msft edited

[Graph API] Accessing ContactFolders outside of "Contacts"

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-sdkmicrosoft-graph-contacts
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I think you want access to folder to get the contacts, if thats the case then you can directly get the contacts of that folder changing the get url. Refer the doc.


0 Votes 0 ·

1 Answer

NucomAGFabianZnd-3089 avatar image
0 Votes"
NucomAGFabianZnd-3089 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.