An API that connects multiple Microsoft services, enabling data access and automation across platforms
Incomplete retrieval of recursive .msg attachmenst via Microsoft Graph API
Rens Rijvers
0
Reputation points
Hey,
i have a question about regarding to Graph API and retrieving emails and their attachments.
Case Description
An email (Email A) contains an attachment in .msg format (Email B). Email B itself also contains another .msg attachment (Email C). The goal is to recursively retrieve all attachments starting from Email A, including their extended MAPI properties. Two Microsoft Graph API calls are used:
- Call 1:
- Call 2:
Environment
- Graph API, reproducible via the graph explorer.
- Requires a messageId referencing an email with nested .msg attachments
Expected behavior
- All attachments should be retrieved recursively.
- Each item object should include a valid id.
- Extended MAPI properties should be present for all nested attachments, consistent with the metadata available in Email A.
Current behavior
- Both API calls return item objects with missing id fields.
- Extended MAPI properties are not included in the response for nested .msg attachments.
Steps to reproduce
- Create an email (Email A) with a .msg attachment (Email B), which itself contains another .msg attachment (Email C) with extended properties.
- Execute the following API call: GET https://graph.microsoft.com/v1.0/{userId}/messages/{messageId}/attachments?$expand=microsoft.graph.itemAttachment/item
- Observe that the response contains:
"item": { "id:" "" }for all attachments and lacks extended MAPI properties.
Context
There is a requirement to retrieve extended properties from .msg attachments.
Thanks you for your time, Rens Rijvers
Microsoft Security | Microsoft Graph
Microsoft Security | Microsoft Graph
Sign in to answer