0
votes

I have a file that is on Sharepoint for the Team and in the folder corresponding to my channel in Microsoft Teams.

E.g. Team Banana channel ripe, so my file is in https://whatever.sharepoint.com/Banana/ripe

I want to share this file to the channel with a message programmatically to get this result:

screenshot

I got the above message in the teams client by going to Files tab, clicking on file and then Start conversation.

I want to share this file using a webhook.

Unfortunately i can't find anything in regards to MessageCard payloads that the webhook seems to use that would allow me to do the above.

I tried adding attachments part of the bot reference to the message like so but had no success:

POST https://outlook.office.com/webhook/whateverelsehere HTTP/1.1
Host: outlook.office.com
Content: application/json
Content-Length: 401

{
  "@type": "MessageCard",
  "text":"This is a message3",
  "attachments": [{
    "contentType": "application/vnd.microsoft.teams.card.file.info",
    "contentUrl": "https://wherever.sharepoint.com/sites/feed-support/Banana/ripe/test.txt",
    "name": "text.txt",
    "content": {
      "uniqueId": "df90889f-e8a7-452a-8795-972be16fac6f",
      "fileType": "txt",
    }
  }]
}
1

1 Answers

0
votes

Currently it is not possible to send files using webhooks. Files support in webhook is something we are working on but we do not have an ETA for it. As of now, the only way of sending files is using Bots.