The mail message does not contains header information

%3CLINGO-SUB%20id%3D%22lingo-sub-2618199%22%20slang%3D%22en-US%22%3EThe%20mail%20message%20does%20not%20contains%20header%20information%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2618199%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20the%20below%20endpoint%20to%20read%20mail%20messages%20from%20a%20given%20mail%20folder%20but%20I%20see%20the%20message%20does%20not%20contain%20header%20information.%3CBR%20%2F%3EEndpoint-%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2FmailFolders%2F%257Bfolderid%257Dmessages%2F%3F%24orderby%3DsentDateTime%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2FmailFolders%2F%7Bfolderid%7Dmessages%2F%3F%24orderby%3DsentDateTime%3C%2FA%3E%3CBR%20%2F%3E%7B%20%22%40odata.context%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2F%24metadata%23users('55f7b855-44a8-46c2-908a-00ff4d54c46e')%2FmailFolders('AQMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkADBkZTAALgAAA--el_XftXZKt0YdPN_913sBAFL-3e9Uo9BKmUKAmISlmIAAAAIBCQAAAA%253D%253D')%2Fmessages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2F%24metadata%23users('55f7b855-44a8-46c2-908a-00ff4d54c46e')%2FmailFolders('AQMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkADBkZTAALgAAA--el_XftXZKt0YdPN_913sBAFL-3e9Uo9BKmUKAmISlmIAAAAIBCQAAAA%253D%253D')%2Fmessages%3C%2FA%3E%22%2C%20%22value%22%3A%20%5B%20%7B%20%22%40odata.etag%22%3A%20%22W%2F%5C%22CQAAABYAAABS%2F93vVKPQSplCgJiEpZiAAAAMRZRE%5C%22%22%2C%20%22id%22%3A%20%22AAMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMABGAAAAAAD-3pfl37V2SrdGHTzfvdd7BwBS-93vVKPQSplCgJiEpZiAAAAAAAEJAABS-93vVKPQSplCgJiEpZiAAAAMTZWmAAA%3D%22%2C%20%22createdDateTime%22%3A%20%222021-08-02T12%3A47%3A39Z%22%2C%20%22lastModifiedDateTime%22%3A%20%222021-08-02T12%3A47%3A42Z%22%2C%20%22changeKey%22%3A%20%22CQAAABYAAABS%2F93vVKPQSplCgJiEpZiAAAAMRZRE%22%2C%20%22categories%22%3A%20%5B%5D%2C%20%22receivedDateTime%22%3A%20%222021-08-02T12%3A47%3A40Z%22%2C%20%22sentDateTime%22%3A%20%222021-08-02T12%3A47%3A39Z%22%2C%20%22hasAttachments%22%3A%20false%2C%20%22internetMessageId%22%3A%20%22%3CMAZPR01MB5442E2218F9D377BD1D514E4E9EF9%3E%22%2C%20%22subject%22%3A%20%22rr%22%2C%20%22bodyPreview%22%3A%20%22rr%22%2C%20%22importance%22%3A%20%22normal%22%2C%20%22parentFolderId%22%3A%20%22AQMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkADBkZTAALgAAA--el_XftXZKt0YdPN_913sBAFL-3e9Uo9BKmUKAmISlmIAAAAIBCQAAAA%3D%3D%22%2C%20%22conversationId%22%3A%20%22AAQkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMAAQAKmsc6svyzlHuJr_l4TQwX4%3D%22%2C%20%22conversationIndex%22%3A%20%22AQHXh5yTqaxzqy%2FLOUe4mv6XhNDBfg%3D%3D%22%2C%20%22isDeliveryReceiptRequested%22%3A%20false%2C%20%22isReadReceiptRequested%22%3A%20false%2C%20%22isRead%22%3A%20true%2C%20%22isDraft%22%3A%20false%2C%20%22webLink%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Foutlook.office365.com%2Fowa%2F%3FItemID%3DAAMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMABGAAAAAAD%252F3pfl37V2SrdGHTzfvdd7BwBS%252F93vVKPQSplCgJiEpZiAAAAAAAEJAABS%252F93vVKPQSplCgJiEpZiAAAAMTZWmAAA%253D%26amp%3Bexvsurl%3D1%26amp%3Bviewmodel%3DReadMessageItem%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Foutlook.office365.com%2Fowa%2F%3FItemID%3DAAMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMABGAAAAAAD%252F3pfl37V2SrdGHTzfvdd7BwBS%252F93vVKPQSplCgJiEpZiAAAAAAAEJAABS%252F93vVKPQSplCgJiEpZiAAAAMTZWmAAA%253D%26amp%3Bexvsurl%3D1%26amp%3Bviewmodel%3DReadMessageItem%3C%2FA%3E%22%2C%20%22inferenceClassification%22%3A%20%22focused%22%2C%20%22body%22%3A%20%7B%20%22contentType%22%3A%20%22html%22%2C%20%22content%22%3A%20%22%26lt%3Bmeta%20http-equiv%3D%22%5C%22Content-Type%5C%22%22%20content%3D%22%5C%22text%2Fhtml%3B%22%20charset%3D%22utf-8%5C%22%22%20%2F%26gt%3B%26lt%3Bmeta%20content%3D%22%5C%22text%2Fhtml%3B%22%20charset%3D%22iso-8859-1%5C%22%22%20%2F%26gt%3B%3CSTYLE%20type%3D%22%5C%26quot%3Btext%2Fcss%5C%26quot%3B%22%20style%3D%22%5C%26quot%3Bdisplay%3Anone%5C%26quot%3B%22%3E%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B!--p%7Bmargin-top%3A0%3Bmargin-bottom%3A0%7D--%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSTYLE%3E%3C%2FMAZPR01MB5442E2218F9D377BD1D514E4E9EF9%3E%3C%2FP%3E%3CDIV%20style%3D%22%5C%26quot%3Bfont-family%3ACalibri%2CArial%2CHelvetica%2Csans-serif%3B%22%2012pt%3D%22%22%3Err%3CBR%20%2F%3E%3C%2FDIV%3E%22%20%7D%2C%20%22sender%22%3A%20%7B%20%22emailAddress%22%3A%20%7B%20%22name%22%3A%20%22some%20name%22%2C%20%22address%22%3A%20%22some%20address%22%20%7D%20%7D%2C%20%22from%22%3A%20%7B%20%22emailAddress%22%3A%20%7B%20%22name%22%3A%20%22some%20name%22%2C%20%22address%22%3A%20%22some%20address%22%20%7D%20%7D%2C%20%22toRecipients%22%3A%20%5B%20%7B%20%22emailAddress%22%3A%20%7B%20%22name%22%3A%20%22some%20name%22%2C%20%22address%22%3A%20%22some%20address%22%20%7D%20%7D%20%5D%2C%20%22ccRecipients%22%3A%20%5B%5D%2C%20%22bccRecipients%22%3A%20%5B%5D%2C%20%22replyTo%22%3A%20%5B%5D%2C%20%22flag%22%3A%20%7B%20%22flagStatus%22%3A%20%22notFlagged%22%20%7D%20%7D%20%5D%20%7D%3CP%3E%3C%2FP%3E%3CP%3EWhen%20using%20java%20mail%20API%20to%20read%20the%20same%20messages%20I%20could%20able%20to%20retrieve%20the%20headers%20information%20as-%3CBR%20%2F%3E%23java_mail%3CBR%20%2F%3Ejavax.mail.Message%20message%3D%20some%20object%3B%3C%2FP%3E%3CP%3EEnumeration%20headers%20%3D%20message.getAllHeaders()%3B%3C%2FP%3E%3CP%3EThere%20is%20no%20clarity%20in%20documentation%20regarding%20this.%3C%2FP%3E%3CP%3EI%20see%20some%20places%20to%20use%20below%20in%20Graph%20API%3CBR%20%2F%3Ecom.microsoft.graph.models.Message%20message%20%3D%20some%20msg%20obj%3B%3CBR%20%2F%3EList%20headers%20%3D%20message.internetMessageHeaders%3B%3CBR%20%2F%3Ebut%20there%20is%20no%20internetMessageHeaders%20value%20in%20response.%3C%2FP%3E%3CP%3EIt%20is%20strange%20for%20me%20that%20when%20reading%20via%20javax.mail.Message%20i%20can%20retrieve%20headers%20but%20not%20via%20MS%20Graph%20API%20com.microsoft.graph.models.Message.%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20achieve%20this%20using%20an%20MS%20graph%20API%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am using the below endpoint to read mail messages from a given mail folder but I see the message does not contain header information.
Endpoint- https://graph.microsoft.com/v1.0/me/mailFolders/{folderid}messages/?$orderby=sentDateTime
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('55f7b855-44a8-46c2-908a-00ff4d54c46e')/mailFolders...", "value": [ { "@odata.etag": "W/\"CQAAABYAAABS/93vVKPQSplCgJiEpZiAAAAMRZRE\"", "id": "AAMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMABGAAAAAAD-3pfl37V2SrdGHTzfvdd7BwBS-93vVKPQSplCgJiEpZiAAAAAAAEJAABS-93vVKPQSplCgJiEpZiAAAAMTZWmAAA=", "createdDateTime": "2021-08-02T12:47:39Z", "lastModifiedDateTime": "2021-08-02T12:47:42Z", "changeKey": "CQAAABYAAABS/93vVKPQSplCgJiEpZiAAAAMRZRE", "categories": [], "receivedDateTime": "2021-08-02T12:47:40Z", "sentDateTime": "2021-08-02T12:47:39Z", "hasAttachments": false, "internetMessageId": "<MAZPR01MB5442E2218F9D377BD1D514E4E9EF9@MAZPR01MB5442.INDPRD01.PROD.OUTLOOK.COM>", "subject": "rr", "bodyPreview": "rr", "importance": "normal", "parentFolderId": "AQMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkADBkZTAALgAAA--el_XftXZKt0YdPN_913sBAFL-3e9Uo9BKmUKAmISlmIAAAAIBCQAAAA==", "conversationId": "AAQkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMAAQAKmsc6svyzlHuJr_l4TQwX4=", "conversationIndex": "AQHXh5yTqaxzqy/LOUe4mv6XhNDBfg==", "isDeliveryReceiptRequested": false, "isReadReceiptRequested": false, "isRead": true, "isDraft": false, "webLink": "https://outlook.office365.com/owa/?ItemID=AAMkAGYyOTI1Yzc5LTFlZjctNDlhYy1hMWQzLTA1MjY0ZmRkMGRlMABGAA...", "inferenceClassification": "focused", "body": { "contentType": "html", "content": "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta content=\"text/html; charset=iso-8859-1\"><style type=\"text/css\" style=\"display:none\"><!--p{margin-top:0;margin-bottom:0}--></style></head><body dir=\"ltr\"><div style=\"font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)\">rr<br></div></body></html>" }, "sender": { "emailAddress": { "name": "some name", "address": "some address" } }, "from": { "emailAddress": { "name": "some name", "address": "some address" } }, "toRecipients": [ { "emailAddress": { "name": "some name", "address": "some address" } } ], "ccRecipients": [], "bccRecipients": [], "replyTo": [], "flag": { "flagStatus": "notFlagged" } } ] }

When using java mail API to read the same messages I could able to retrieve the headers information as-
#java_mail
javax.mail.Message message= some object;

Enumeration headers = message.getAllHeaders();

There is no clarity in documentation regarding this.

I see some places to use below in Graph API
com.microsoft.graph.models.Message message = some msg obj;
List headers = message.internetMessageHeaders;
but there is no internetMessageHeaders value in response.

It is strange for me that when reading via javax.mail.Message i can retrieve headers but not via MS Graph API com.microsoft.graph.models.Message.

Is there any way to achieve this using an MS graph API?

0 Replies