4

I've been trying to post messages with pictures in Team Channels for some time now.

In short: Is it possible that the same preview for pictures is shown as in a normal member post? The picture should be displayed as large as possible and when clicking on the picture a large version should be shown.

The data is sent in JSON format via cURL to a team webhook. First I have used the following information to send Webhook. https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using

This worked fine and the messages arrive in the created channel as expected. Since in the later applications pictures of graphs are to be sent I dared to take the next step and tried to attach pictures.

First i tried an invoke of base64 images, technically this worked, but for larger images i got a http error 413 which is caused by too large messages after my research.

{
    "@type": "MessageCard",
    "text": "Here are test images",
    "sections": [
        {
            "images": [
                {
                    "image": "data:image/png;base64,ImageBase64Content"
                }
            ]
        }
    ]
}

Code from: Teams: Invoke-Webrequest sending base64 string (png) to Teams

My second attempt is based on posting images that already exist in sharepoint as links in the teams channel. (Mainly as a workaround for the base64 Limit)

{
    "@type": "MessageCard",
    "text": "Here are test images",
    "sections": [
        {
            "images": [
                {
                    "image": "https://LinkToSharepointImage/Image.png"
                }
            ]
        }
    ]
}

Both methods work but show the picture only as a small message in the post. There are no details to see and if you click on the picture there is no reaction.

is it possible to make the image much bigger and put a link on the image that enlarges it when clicked? In principle the same functions as a normal team post.

In the stack post already mentioned, reference is made to the "Cards Reference": https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference

But many examples like the "Hero Cards" are unfortunately not compatible. Example of Hero Card Seattle Mono Rail

progamer150
  • 41
  • 1
  • 2
  • Could you please tell us what is the image size you are trying to sent? – Trinetra-MSFT Mar 13 '20 at 05:37
  • 1
    @Trinetra-MSFT : I am trying to upload a image using MS Teams Task module form. I am able to convert image into base64 on client side when I am trying to send it as a messageCard I get an error, but for smaller images it works. – Manish Chitre May 01 '20 at 07:30

0 Answers0