Warm tip: This article is reproduced from stackoverflow.com, please click
microsoft-graph

Determining forwarded and replied to email messages in Microsoft Graph API

发布于 2020-04-15 10:42:26

I'm building a .NET Core WEB API that serves as an automation layer over Outlook messages and calendars using the Microsoft Graph SDK. One of the requirements is to identify which messages have been replied to or have been forwarded.

It's not yet clear to me how I can determine whether an email message has been forwarded or replied to when using the results of Graph Explorer "My Mail" sample request.

This answer states that the ConversationId property remains the same (which is indeed the case) and that the only indication is either "FW:" or "RE:" prefixed to the subject. Also in the Message documentation I can't seem to find a proper, reliable way of identifying those.

Can anyone tell me how this can be done?

Questioner
J. Michiels
Viewed
111
Glen Scales 2020-02-04 07:25

If your looking at mail in the Inbox and you want to know if they have been acted on by a Mail client (eg Oultook or OWA) then you could use PidTagLastVerbExecuted https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtaglastverbexecuted-canonical-property (this is how outlook determines it) eg

https://graph.microsoft.com/v1.0/me/messages?$expand=SingleValueExtendedProperties($filter=(Id%20eq%20'Integer%200x1081'))

If a Message had been replied to you would see a result like

            "singleValueExtendedProperties": [
            {
                "id": "Integer 0x1081",
                "value": "102"
            }
           ]

This still isn't 100% reliable so if your doing this for Auditing the only way is using the Tracking Logs (MessageTrace in Office365)