Forum Discussion
chisr
Sep 11, 2023Copper Contributor
Azure teams bot: how to receive files in a group chat
We have a teams bot in our organization. In a personal chat we are able to get an attachment activity with the sharepoint downloadUrl when we upload a file in the chat, but when we try to add this bo...
Prasad_Das-MSFT
Microsoft
Sep 11, 2023chisr - Teams bot API only support files in personal
context. However, you can use Microsoft Graph which works for bots in all Microsoft Teams scopes:
personal
channel
groupchat
Using Graph API, you can post messages with card attachments that refer to existing SharePoint files, using the Graph APIs for OneDrive and SharePoint.
Ref: Send and receive files using bot - Teams | Microsoft Learn
Send chatMessage in a channel or a chat - Microsoft Graph beta | Microsoft Learn
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
chisr
Sep 11, 2023Copper Contributor
Thanks. I already found a solution. When we get an empty attachment in the webhook, we send a request 'chats/${chatId}/messages/${messageId}/attachments' and I got the url.