title: How to retrieve ItemAttachment contents from Office 365 REST API?
body: <p><strong>UPDATE</strong>: Many thanks to Venkat for answering this below!</p>
  
  <p>The get request needs to be formatted as follows in order to retrieve the contents of a .msg attachment:</p>
  
  <p><strong><code>https://outlook.office365.com/api/v1.0/me/messages/{messageid}/attachments/{AttachmentId}?$expand=Microsoft.OutlookServices.ItemAttachment/Item</code></strong></p>
  
  <hr>
  
  <p>(Original question)</p>
  
  <p>I originally asked this question in Microsoft's Office Dev Center. One of the moderators requested that I pose this question here.</p>
  
  <p>I've been having a lot of success using the Office 365 Mail REST API. However, when trying to retrieve email messages that are attached to other emails (i.e., Item Attachments like .msg files), the REST API does not deliver.</p>
  
  <p>When I make a GET request like this for an email that has a .msg file attached to it, I get all the attachment properties <em>except</em> the "Item" property, which should contain the attachment (according to the Office 365 Mail REST API resource guide here: <a href="https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#RESTAPIResourcesItemAttachment" rel="nofollow">https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#RESTAPIResourcesItemAttachment</a>)</p>
  
  <p>GET: <a href="https://outlook.office365.com/api/v1.0/me/messages/" rel="nofollow">https://outlook.office365.com/api/v1.0/me/messages/</a>{messageid}/attachments</p>
  
  <p>RESPONSE:</p>
  
  <pre><code>{
    "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/{messageid}/Attachments",
    "value": [
      {
        "@odata.type": "#Microsoft.OutlookServices.ItemAttachment",
        "@odata.id": "https://outlook.office365.com/api/v1.0/Users('{useremailaddress}')/{messageid}/Attachments('{messageid}')",
        "Id": "{messageid}",
        "Name": "{subject}",
        "ContentType": "message/rfc822",
        "Size": 54425,
        "IsInline": false,
        "DateTimeLastModified": "{timestamp}"
      }
    ]
  }
  </code></pre>
  
  <p>Am I doing something wrong?</p>