0

When i get mail message from o365 Graph using

https://graph.microsoft.com/v1.0/users/XXXX@xxx.xx/messages/?$select=InternetMessageHeaders

Not all headers is present in result. I´m missing From, To and CC. Same result in graph SDK for .net

Looking at same mail in OWA view original shows From and To as headers.

Anyone else has this problem, or is this expected? I just has a feeling i have seen this headers in this result, but i´m not at all sure.

LooC
  • 49
  • 5

1 Answers1

2

I don't know the reasoning behind it but the Graph doesn't return all the header properties when you use InternetMessageHeaders prop. If you want all the headers you need to use the PidTagTransportMessageHeaders extended property https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagtransportmessageheaders-canonical-property which will show you what you see in Outlook (you will need to parse it yourself though)eg

https://graph.microsoft.com/v1.0/me/MailFolders('Inbox')/messages('...=')?$select=InternetMessageHeaders&$expand=singleValueExtendedProperties($filter=id eq 'String 0x007D')
Glen Scales
  • 20,495
  • 1
  • 20
  • 23