Open Lindvorn opened 3 years ago
@Lindvorn I am trying to get in touch with the Outlook team to find more about this issue.
Meanwhile, please post this question on Microsoft Q & A - https://docs.microsoft.com/en-us/answers/index.html using microsoft-graph
tag, StackOverflow.
Thank you for reporting this issue. This appears to be an issue or limitation with the service APIs. Unfortunately, as the Microsoft Graph SDK team, we do not have ownership of the APIs that are causing you issues. We invite you to create a question about the service API to Microsoft Q&A and tagged with one of the [microsoft-graph-*] tags, that way it will get routed to the appropriate team for them to triage:
https://aka.ms/msgraphsupport or directly https://aka.ms/askgraph
For now, we will close the issue on our side but feel free to open it in the relevant repository if you think the issue is specific to SDK. Please let us know if this helps!
Note: We will close this repository on April 19, 2024.
Bug Report
Prerequisites
Description
We have an application that uses Graph api to get the attachments. Our users want to D&D attachment from https://outlook.live.com/ and download it to our application. When attachment is dropped we get the dataTransfer data that is like
{"itemType":"attachment","attachmentFile": {"attachmentItemId":"AAMkADBkMmNjYzE4LTFhZTItNGY0YS04NzZkLTIxMDU5ZTVhYWUyOABGAAAAAAB51tRaMbU1Rry86qyNq77+BwDyVahfS/wsQKJbKNDpfFCoAAAAAAENAADyVahfS/wsQKJbKNDpfFCoAAOEAA/GAAABEgAQAHcgT+UU859Dn62Sfa16m8Y=", "name":"invite.ics","size":2767,"fileType":5, "type":"ItemIdAttachment:#Exchange","ContentType":"application/ics"}}
Then we use endpoint to search for all emails that contains that attachment by name https://graph.microsoft.com/v1.0/me/messages?$search="attachment:invite.ics"&$expand=attachments($select=id,name,size)Our next guess would be to search for id that matches the attachmentItemId in dataTransfer to find email id and get the attachment content. But id from dataTransfer and id that we go from search are different. Although by name and size they should match. We tried using translateExchangeIds to get different ids to do the match but nothing worked so far. Also we tried to do the search request using headers: Prefer:IdType="ImmutableId" but ids of attachments are no different than the ususal request.
Also I should note that the user uses email like "user@company.com" and to get the token we select 'work account'.
How can one download the attachment using D&D datatransfer object from https://outlook.live.com/ ?
Steps to Reproduce
Expected behavior: attachment is found by attachmentItemId
Actual behavior: attachmentItemId is not found in emails's attachments although file name, size are matches the drag&dropped file
SDK Version - "@microsoft/microsoft-graph-client": "^2.2.0", AB#9757