Replace Image files with bot using API in MS Teams chat

Kalinga Somana 25 Reputation points
2023-11-30T08:01:34.9+00:00

Hi Everyone,

We are developing an MS Teams bot where we have a use case to replace an Image file with another Image file. We have implemented the scenario using the SharePoint APIs. But there is an issue with it. If we download the file from the SharePoint list of files, we get the replaced file but if we try to download the file from Teams Chat Preview, we can still download the original file, not the replaced one.

I have looked over the network logs, the image file is getting saved in two different endpoints (SharePoint and asyncgw.teams.microsoft.com) and asyncgw.teams.microsoft.com is used for previewing and downloading the file from the teams chat.

Is there any way we can point the download URL in MS Teams image preview to the SharePoint image URL or can we replace the file in asyncgw.teams.microsoft.com with some API call?

Thanks!

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,894 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,612 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,948 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.