I am using the the following Graph API URL to retrieve the filename(s) attached to an email:
https://graph.microsoft.com/v1.0/me/messages/*/attachments
however, it is no longer returning the attached filename(s) for '.msg' files. The file extension is missing. Please see below example returns:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('')/messages('')/attachments",
"value": [
{
"@odata.type": "#microsoft.graph.itemAttachment",
"id": "*",
"lastModifiedDateTime": "2021-08-13T11:21:29Z",
"name": "Original Email",
"contentType": null,
"size": 45795,
"isInline": false
}
]
}
Where as it is for other file types:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('')/messages('')/attachments",
"value": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"@odata.mediaContentType": "application/octet-stream",
"id": "",
"lastModifiedDateTime": "2021-08-13T11:14:07Z",
"name": "Original Email.mht",
"contentType": "application/octet-stream",
"size": 54693,
"isInline": false,
"contentId": null,
"contentLocation": null,
"contentBytes": ""
}
]
}
NB: sensitive info has been redacted (*).
I can see that the @odata.type is returned differently:
@odata.type": "#microsoft.graph.itemAttachment
@odata.type": "#microsoft.graph.fileAttachment
I'm not sure why this is, the email is attached in the same way.
In both of the above cases, using Outlook, I sent myself an email, saved it to my local filesystem, created another email, attached the previously saved file and sent myself the new email with the saved email attached. Then made the request using the stated URL (and many other variations).
I have looked all over and no request URL that I have used returns the file extension for this type.
Is there a way to return the filename for '.msg' files?