I have a problem with the Microsoft Graph Rest API. I have written a progam that should read the contacts from Outlook and later match them again and again. For this I use the ID from the contacts record. My program reads over all folders and gets the necessary information about all contacts. This works quite well so far.
Now I surprisingly got a problem, because the ID of a contact in Outlook can change and therefore I lose my reference to my external dataset.
The following case causes me problems.
- I create a contact in Outlook. This contact has an ID after reading it out via the Rest API.
{'@odata.etag': 'W/"EQAAABYAAADqyc40Bfr0RZDGyWTzcCdWAADu40Xu"', 'id': 'AAMkADE4MWMwOTY4LTM2ODAtNDAyZS1iZDgwLWEyYjE3NTUxY2U4OABGAAAAAACYta-jK-baT5Lfw8NopJJYBwDqyc40Bfr0RZDGyWTzcCdWAADCW0U2AADqyc40Bfr0RZDGyWTzcCdWAADvCEp-AAA=', 'displayName': 'Max Mustermann'}
- I use the "move to" option for a contact to move it to another folder. After that this contact has a different ID.
{'@odata.etag': 'W/"EQAAABYAAADqyc40Bfr0RZDGyWTzcCdWAADu40YP"', 'id': 'AAMkADE4MWMwOTY4LTM2ODAtNDAyZS1iZDgwLWEyYjE3NTUxY2U4OABGAAAAAACYta-jK-baT5Lfw8NopJJYBwDqyc40Bfr0RZDGyWTzcCdWAADvCHYwAADqyc40Bfr0RZDGyWTzcCdWAADvCLTCAAA=', 'displayName': 'Max Mustermann'}
Can anyone give me a tip on how to prevent this? ... or is there a way to read the old ID's of a contact?
Maybe someone can explain me, why the ID changes at all, if I move the contact to a folder.
Any help is welcome.
The reason is described here:
https://learn.microsoft.com/en-us/graph/outlook-immutable-id
And also the solution:
https://learn.microsoft.com/en-us/graph/outlook-immutable-id#how-it-works