Microsoft Teams: Inline image links from chat messages - can they be re-used in other chats?

1.4k views Asked by At

Let's assume a chat bot (built using the Microsoft Bot Framework) receives chat messages from users in 1:1 Teams chats. Those messages contain inline images that users paste from the clipboard directly into the chat message.

Those images are represented in the message as img elements like this:

<div>Check this out:<span><img height="20" src="https://eu-api.asm.skype.com/v1/objects/0-weu-d19-123400000000000000000000/views/imgo"
        width="20" id="x_0-weu-d19-123400000000000000000000" itemscope="" itemtype="http://schema.skype.com/AMSImage"
        style="vertical-align:bottom; width:20px; height:20px"></span></div>

The bot sees those image links and needs to somehow store them, or a link to them. Let's say we want to keep it easy and only store the link.

Here's the question: Can those inline image links be stored and later re-posted in other Teams chats?

Let's say the bot chooses the "best" images and re-posts them once a week to a "best photos" Teams channel. This new chat message - can it just re-use those original image links?

There are similar questions out there which mainly focus on downloading inline images, which apparently requires some kind of authentication. Here is somebody trying to grab those images via Power Automate: Power Automate - retrieve an inline Teams image from Microsoft graph

Is there any documentation about those image links? Who has access to those images? How long? When do those links expire? After removing the chat message that contained the link? Never?

Any insights about those inline image links and the access mechanisms involved are appreciated.

1

There are 1 answers

3
Jagadeesh-MSFT On BEST ANSWER

using https://graph.microsoft.com/beta/me/chats/{chat-id}/messages/{id} graph request you will get src as shown in the below image.

enter image description here

you can get images from the request url in the src, from there you can store those images and can re-posted to another chat. enter image description here