nilesh
nilesh

Reputation: 1336

Microsoft Graph API: Immutable Id for received email

I'm using the Microsoft Graph API to send and receive emails. When sending an email, I create a draft with the header Prefer: IdType="ImmutableId" to obtain an immutable ID, which I then save in my database. Later, I use this ID to send a reply to the email using the reply APIs.

However, when receiving incoming emails through a subscription, I'm not sure how to obtain the immutable ID for these emails. I've tried passing the same immutable header (Prefer: IdType="ImmutableId") in the GET message API, but it doesn't return the immutable ID.

What is the proper way to implement this functionality? How can I obtain the immutable ID for incoming emails received via the Microsoft Graph API subscription?

Upvotes: 0

Views: 920

Answers (1)

Glen Scales
Glen Scales

Reputation: 22032

When you created a subscription you need to use the immutableId header https://learn.microsoft.com/en-us/graph/outlook-immutable-id#immutable-id-with-change-notifications. It can only be done at the time of creation for the subscription so it wont work on existing subscription created without using this header.

Upvotes: 1

Related Questions