Mail Message api not returning messages thread.

UZAIR SEIKHAI 31 Reputation points
2021-07-20T16:00:26.837+00:00

Dear Concern,

I am using Microsoft graph mail API and fetching message by this api https://graph.microsoft.com/v1.0/me/messages/{id} but is not giving thread messages.How can I get thread replies of inbox message.

116369-screenshot-from-2021-07-20-20-55-45.png

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

Accepted answer
  1. Glen Scales 4,436 Reputation points
    2021-07-22T01:12:02.483+00:00

    The https://graph.microsoft.com/v1.0/me/messages/{id} endpoint your using will only return the Message with that particular Id. To get all the message within a particular thread you would need to use a Filter on the Messages Collection based on the CoversationId property of one of the Messages in that thread eg

    /Messages?$filter=conversationid eq 'Message.ConversationId'
    

    or

    /Messages?$filter=conversationid eq 'Message.ConversationId'&$orderby=receivedDateTime desc
    

    If you want them ordered by last received where Message.ConversationId is the conversationId from the Message

        "@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('7f180cbb-a5ae-457c-b7e8-6f5b42ba33e7')/messages/$entity",
        "@odata.etag":"W/\"CQAAABYAAAC4ofQHEIqCSbQPot83AFcbAAAnjjuZ\"",
        "id":"AAMkADhMGAAA=",
        "createdDateTime":"2018-09-09T03:15:05Z",
        "lastModifiedDateTime":"2018-09-09T03:15:08Z",
        "changeKey":"CQAAABYAAAC4ofQHEIqCSbQPot83AFcbAAAnjjuZ",
        "categories":[
    
        ],
        "receivedDateTime":"2018-09-09T03:15:08Z",
        "sentDateTime":"2018-09-09T03:15:06Z",
        "hasAttachments":false,
        "internetMessageId":"<MWHPR6E1BE060@MWHPR1120.namprd22.prod.outlook.com>",
        "subject":"9/9/2018: concert",
        "bodyPreview":"The group represents Nevada.",
        "importance":"normal",
        "parentFolderId":"AAMkADcbAAAAAAEJAAA=",
        "conversationId":"AAQkADOUpag6yWs=",
    

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.