Microsoft Graph REST API v1.0 mailFolder id not unique?

Martin Wouters 21 Reputation points
2021-10-13T18:08:52.057+00:00

Hi,

I'm having a problem where multiple mailFodlers have the same ID. I tried Stackoverflow first but no answer.

My folder structure

Inbox  
  |- FolderA  
  |   |-ChildA1  
  |   |-ChildA2 ect.  
  |  
  |- FolderB  
      |-ChildB1  
      |-ChildB2 ect.  

The problem

In the documentation is stated that the id-property for a mailFolder is unique. But several childs from FolderA does have the same id's as childs from FolderB.

a child of FolderA

Array  
(  
    [id] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAH2RGbAAA=  
    [displayName] => childAx  
    [parentFolderId] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAETiFqAAA=  
    ...  
)  

a child of FolderB

Array  
(  
    [id] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAH2RGBAAA=  
    [displayName] => childBx  
    [parentFolderId] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAETiFtAAA=  
    ...   
)  

As shown multiple mailFolders does have the same id.

Steps I took

Using /users/{id | userPrincipalName}/mailFolders/Inbox/childFolders I get the id's for FolderA and FolderB. After that I get the childFolders for both folderA and folderB via /users/{id | userPrincipalName}/mailFolders/{id}/childFolders

When using /users/{id | userPrincipalName}/mailFolders/{id} I get the mailFolder data from one of the folders with the same id's. How can I point out to another? Using a combination of the parentId and id?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,017 questions
0 comments No comments
{count} votes

Accepted answer
  1. Glen Scales 4,441 Reputation points
    2021-10-13T23:09:25.36+00:00

    What happens if you try to bind to the FolderId directly which folder do you get ? eg /users/blah@keyman /mailboxfolder/id

    The FolderId's use a global counter so they can almost look exactly same but not be https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcdata/4b5160da-8412-424c-89de-03d95d707c12 in the past I've seen similar issues where Case wasn't taken into account when looking at the base64 value (or in that case it was being stored in database case insensitive). So if your doing a comparison decode the base64 to Hex and then compare that as well.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.