Forum Discussion
Pierre_Z92
Nov 29, 2022Copper Contributor
Download chatMessage attachments
Hello, I am using the Graph API to fetch chatMessages of a particular user (using delegated permissions). I am unable to download attachments of those chatMessages ; a GET query to the conten...
Meghana-MSFT
Microsoft
Dec 01, 2022we are also seeing the same behavior. We will check internally and get back to you.
Meghana-MSFT
Microsoft
Dec 01, 2022Pierre_Z92 - Engineering team has said that -
You can use this API - https://learn.microsoft.com/en-us/graph/api/shares-get?view=graph-rest-1.0&tabs=http Plug in the sharepoint link from chatMessage attachment and it will get you the download links you need. Additional reference https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http
- Pierre_Z92Dec 01, 2022Copper Contributor
Thanks for your quick reply.
I have tried this endpoint, and it seems to only work with files belonging to the user from whom my app have delegated permissions.
My case is:
- My app acts on behalf of user A (with delegated permissions)
- User B sends a Teams chatMessage with an attachment to user A
- Attachment is stored in the user B sharepoint/one drive
- Graph API (/shares/{shareIdOrEncodedSharingUrl}) returns an "unauthenticated" error
This exact same endpoint works for files stored in user A one drive.
It looks like I missed a permission but I don't know which one.
My app currently have these delegated permissions:
- Chat.ReadWrite
- Files.ReadWrite.All
- Sites.ReadWrite.AllCan you help me ?
- Pierre_Z92Dec 13, 2022Copper ContributorUp ?
- Meghana-MSFTDec 13, 2022
Microsoft
We are checking on it internally with the engineering team. We will keep you posted once we have an update.