Check whether if a particular email has not been replied in Microsoft graph API

cool atta 1 Reputation point

Hi folks;
I am working on a problem in which I could find out that if a particular email or conversion has been replied using Microsoft graph API. I have tried different logics like create time, sent time, received time but none worked for me. Please guide, your help would be highly appreciated.

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

1 answer

Sort by: Most helpful
  1. Glen Scales 4,431 Reputation points

    There are a number of ways to do that, if you want to find the response to a message the easiest way should be to take the InternetMessageId from the original email in the Inbox eg

    GraphServiceClient graphServiceClient = new GraphServiceClient(credentials);  
    var Messages = graphServiceClient.Users[""].MailFolders["Inbox"].Messages.Request().Select("Subject,InternetMessageId").Top(1).GetAsync().GetAwaiter().GetResult();  

    and then you can search for any messages in the SentItems folder that are In-Reply-to that message using the In-Reply-To headers extended property

        String filterval = $"singleValueExtendedProperties/Any(ep: ep/id eq 'String 0x1042' and ep/value eq '{Messages[0].InternetMessageId}')";  
        var Replies = graphServiceClient.Users[""].MailFolders["SentItems"].Messages.Request()  

    Another approach can be to use the LastVerbExecuted extended property