In my application that uses the Outlook REST API, in order to support inlined images in html emails, I need to retrieve the ContentId
of the File Attachments of a given email.
Note: in an html email inlined images are html tags of the form <input scr="cid:mycontentid">
I manage to get this information at url https://outlook.office.com/api/v2.0/me/messages/{message_id}/attachments
The problem is the returned json also contains the ContentBytes
which can be arbitrary big for large attachments.
I tried several syntaxes to retrieve only the fields that I need such as:
https://outlook.office.com/api/v2.0/me/messages/{message_id}/attachments?$select=Id,ContentId
or '$select=Id&$expand=ContentId'
none of them worked, resulting in a bad request
{"error":{"code":"RequestBroker-ParseUri","message":"Could not find a property named 'ContentId' on type 'Microsoft.OutlookServices.Attachment'."}}
The expected types at url '/attachments'
are Microsoft.OutlookServices.Attachment
which is a base type for File Attachments and Item Attachment.
I would like to retrieve the specific member for File Attachments (ContentId
) or to discard the heavy ContentBytes
contained in the result.