Abhijeethmodi
Feb 27, 2023Copper Contributor
Status:
New
Sending attachments to ms teams from an external bot framework
Hello, I am using microsoft Bot SDK v3 framwork. I tried sending attachments to the msteams from the external bot framework, first by uploading the attachment to the sharepoint and then used the...
Abhijeethmodi
Feb 27, 2023Copper Contributor
I tried using the api, when I send only text message, it is working fine, when I add the attachment payload as mentioned in the documentation https://learn.microsoft.com/en-us/microsoftteams/platform/resources/bot-v3/bots-files
{
"attachments": [{
"contentType": "application/vnd.microsoft.teams.file.download.info",
"contentUrl": "https://contoso.sharepoint.com/personal/johnadams_contoso_com/Documents/Applications/file_example.txt",
"name": "file_example.txt",
"content": {
"downloadUrl" : "https://download.link",
"uniqueId": "1150D938-8870-4044-9F2C-5BBDEBA70C9D",
"fileType": "txt",
"etag": "123"
}
}]
}, I am facing the issue the issue
{
"error": {
"code": "BadArgument",
"message": "Unknown attachment type"
}
}
the api I used to send messages to the msteams is https://smba.trafficmanager.net/amer/v3/conversations/a****/activities
I just wanted to clarify, in the payload download url is the url which we get by the PUT API for
https://graph.microsoft.com/v1.0/drives/:driveId/root:/doc1/sample3.txt:/contentand passing attachment as a binary file, in the reesponse I am getting
@microsoft.graph.downloadUrl (considering this as the downloadUrl ) and
webUrl (considering this as the contentUrl ). Please correct me if I am wrong and I need help for this issue.
Thanks