Can we send file as an attachment along with message in teams programmatically? - botframework

Can we send file as an attachment along with message in teams using webhooks or api?
Currently we can send only text message using webhooks and not attach files.
I want to mimic the action in the screenshot below:-
Attach file present in the system
There are ways to first upload file to one drive and then send its link in the teams message but I do not want to use that solution.
Is there a way to directly upload file from your system as an attachment to the microsoft teams using webhook or any alternative way.
Thanks!!

Currently it is not supported to send attachments using webhook. You will need to use bot to send and receive attachments. You can refer this link.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4

Related

Attaching files to a channel on Microsoft Teams

I'm trying to send files to a channel in Teams, but I've found examples of asking a bot for something (for example I write 1 and he send me an image), and the bot's able send images or files like attachments (I don't need adaptive cards or message cards if your idea is Incoming webhook).
I need to send with a schedule request attachment files to teams, is that possible? For example, if such is possible to send a set of image attachment every 1 hour.
Thanks
In case this is still not resolved.
Please take a look at Send and receive files through your bot doc to see how your bot can send/receive file attachments.
For bot to trigger message based on backend trigger, please take a look at Send
proactive messages.
Sample code for both of these scenarios can be found in Bot Framework sample code repo.

Send file via Teams (like MAPISendMail)

My (editor-like) Windows desktop program can create a new e-mail with the current project attached using MAPISendMail. A customer wants the same functionality for Microsoft Teams.
For the web version, I think I can probably do that with Graph API.
But I can't find anything for the desktop app version. Is there a way to do that?
Bonus:
It would be great if the user could manually specify recipient + body text in Teams (and not in my program).
So you can't actually attach files to messages directly - you basically upload the file to a web location, and then provide a link to the file in the message. As an example, you can upload to the SharePoint document library that exists in the "Files" tab (something like this). Then, in terms of sending the message, you can send to a Team/Channel quite easily using a Webhook. This does not support #mentions the moment though. Another option is to use Graph to send the message.
If you're wanting instead to send a kind of 'private' message to the user, you'd need to look into creating a bot, and sending a 'Proactive' message

How to send file as attachment to the Microsoft Teams channel?

I have check the Graph API using which we can send message to the channel but I am not getting any example to send files to the channel as an attachment can anyone help me with this.
You can post messages with card attachments referencing existing SharePoint files using the Microsoft Graph APIs for OneDrive and SharePoint. Using the Graph APIs requires obtaining access to a user's OneDrive folder (for personal and groupchat files) or the files in a team's channels (for channel files) through the standard OAuth 2.0 authorization flow.
Please have a look at Send and receive files documentation.

How to send files with Sinch Instant Message?

I am developing a chat app and I am using Sinch SDK for JavaScript. My question is simple.
How can I send files through the Instant Message, to another user that I am chatting with?
It's only text messages, no attachments.
Sinch until now supported text only , therefore you can benefit from texting attachments between two devices.
Make your own API to upload files to your server when uploading is successfully done you can send json object to sinch client to tell him an file send successfully like this
{ "type":"image" , "value":"<your-url-image-in-your-server>"}
The receiver device can fetch this message and convert it from text to json object and receive the file from value attribute.
And you can do same for any type of files (Images - Sound - PDF ...etc).
I hope to help any one to use Sinch for sending attachments.

How to send email with an attachment using Windows Phone 7 API?

My WP7 application requirement is to send the email with an attachment and use device default SMTP settings.
I have tried EmailComposeTask class but it doesn't have any member for attachment.
The other idea, i am thinking is to upload the file on server and then send the email from that server.
What you think if there is no way to send the email with an attachment using WP7 API?
Your observation is correct, at this point in time EmailComposeTask doesn't support attachments and this is the only facility to send email programatically from the device at the moment.
As you note, you can communicate with a server which can perform this task on behalf of your app.
I found a wp7 and wp8 library that does it: http://www.windowsphonegeek.com/marketplace/components/livemailmessage
Try to create web service to send mail in your webserver. so, we can call the from your app to send mail.
I hope upcoming version it will be possible!
Please check this URL for more details http://forums.silverlight.net/forums/p/209808/493532.aspx
I've found this article, but I did not make any test yet.
From the author:
EmailComposeTask won’t allow you to send attachments, but this doesn’t mean that you cannot send files through it. .NET Framework has these two amazing methods: Convert.ToBase64String and Convert.FromBase64String. The first will allow the developer to convert a byte array (byte[]) to a Base64-encoded string, the other one will do the same operation in reverse.
Reference:
Pushing the Limits of the Windows Phone SDK and Sending Files via EmailComposeTask

Resources