Programmatically getting the MIME content of an outlook message using Microsoft Graph API

“How to get the MIME content of a given outlook message using Microsoft Graph API?”. This is one of the oldest request that i used to get from the custom app developers using Microsoft Graph API that i interact with Smile

The capability to get MIME message body is currently available only in the /beta version. As i updated earlier, similar to any other APIs in preview status, it is subject to change. So do not use this capability in production apps.

So there are two ways you can get this,

  • You can append a $value segment to a get-message operation on that message.
  • If the message is attached to an Outlook item or group post, you can append a $value segment to a get-attachment operation on that item or group post.



  • Above, i pass the ID of the outlook message
  • Also, i run the query in beta endpoint


From: MyAnalytics <>

To: Megan Bowen <>

Subject: MyAnalytics | Your past week

Thread-Topic: MyAnalytics | Your past week

Thread-Index: AQHUSWCwzjiRXvHVmk2zYvKObxNRHg==

X-MS-Exchange-MessageSentRepresentingType: 1

Date: Mon, 10 Sep 2018 23:47:53 +0000


Content-Language: en-US

X-MS-Has-Attach: yes

X-MS-Exchange-Organization-SCL: -1


X-MS-Exchange-Organization-RecordReviewCfmType: 0

Content-Type: multipart/related;

MIME-Version: 1.0


Content-Type: multipart/alternative;


Content-Type: text/plain; charset="Windows-1252"

Content-Transfer-Encoding: quoted-printable

[MyAnalytics logo] <


September 2=968, 2018

Hi Megan Bowen,

MyAnalytics helps you spend your time on the people and things that matter.

[Focus time illustration]       [Calendar illustration]         [Important =

person illustration]

Protect time for your work

Minimize unproductive collaboration

Strengthen important relationships

[Secure lock illustration]

For your eyes only

Your data is private and secure. No one has access to it but you.

Find out more > <



<html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-= 1"> <style type=3D"text/css" style=3D"display:none;"><!-- P {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3D"ltr"> <div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt;color:#000000;font= -family:Calibri,Helvetica,sans-serif;" dir=3D"ltr"> <p style=3D"margin-top:0;margin-bottom:0">The press conference will be on M= ay 15. We arranged to have the press gather at 2pm outside the main entranc= e.</p> </div> </body> </html> --_000_MWHPR22MB100769D1513B3DC0F007B2ECD4220MWHPR22MB1007namp_--


For more info, you can refer the documentation here.

Hope this helps.