question

UZAIRSEIKHAI-1445 avatar image
0 Votes"
UZAIRSEIKHAI-1445 asked UZAIRSEIKHAI-1445 commented

Mail Message api not returning messages thread.

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-mail
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

GlenScales-6756 avatar image
0 Votes"
GlenScales-6756 answered UZAIRSEIKHAI-1445 commented

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=",


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It works thanks.

0 Votes 0 ·