0

I'm trying to use the MS graph API to get the In-Reply-To message header without having to return the entire header (internetMessageHeaders). I already get several properties (such as bccRecipients, from, id) which are documented here

I've seen several SO questions asking this and they point to using SingleValueExtendedProperties/internetMessageHeaders with a $filter clause. I've tried this and it appears to only work with properties which are documented

This is what I've tried all give a 404 error (i've checked the the In-Reply-To header is present on the actual message)

https://graph.microsoft.com/v1.0/me/messages/MSG_ID?
$select=Subject,internetMessageId,from,id,bccRecipients,
SingleValueExtendedProperties&$expand=SingleValueExtendedProperties($filter=In-Reply-To eq 'String 0x007D')
https://graph.microsoft.com/v1.0/me/messages/MSG_ID?
$select=Subject,internetMessageId,from,id,bccRecipients,
internetMessageHeaders&$expand=SingleValueExtendedProperties($filter=In-Reply-To eq 'String 0x007D')
https://graph.microsoft.com/v1.0/me/messages/MSG_ID?
$select=Subject,internetMessageId,from,id,bccRecipients,
internetMessageHeaders&$expand=internetMessageHeaders($filter=In-Reply-To eq 'String 0x007D')
jack west
  • 569
  • 1
  • 4
  • 14

1 Answers1

2

You need to request PR_IN_REPLY_TO_ID MAPI property (0x1042001F)

$expand=singleValueExtendedProperties($filter=id eq 'String 0x1042')
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thanks, I see what I was doing wrong now. I'm not familiar with MAPI, could you link to where I can find the associated values? Also you specify two things 0x1042001F and 0x1042, only 0x1042 works, what is 0x1042001F for? – jack west Jan 21 '22 at 16:17
  • 1
    MAPI property tags have two parts - the id (0x1042) and and the property type (0x001F = PT_UNICODE). You can see the property tags and property values in in OutlookSpy (https://www.dimastr.com/outspy, click IMessage button). You can also construct Graph queries from property tags - click Message button on the Graph group on OutlookSpy ribbon, click "Query Parameters", then the button next to the $expand checkbox. – Dmitry Streblechenko Jan 21 '22 at 16:25
  • Here is the doc to the 0x1042: https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtaginreplytoid-canonical-property – Omzig Mar 14 '23 at 20:01