MS Teams essentials - pulling text, image and video out of chat via API?

Jelle Lippens 1 Reputation point
2021-12-02T10:40:34.623+00:00

Hi there,

We currently have a solution built that pulls images, text, video, gifs and images from selected Channel in MS Teams and our solution visualize this a a URL feed that can be used on internal communication displays.

We the new Teams essentials it seems they have stripped channels from it so I was wondering if we could still use the API to pull images, text, video, gifs and images (maybe not all of it) from specific (group) chats?

Thank you very much for the feedback.

With optimism

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,651 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. awijekoon 950 Reputation points Microsoft Vendor
    2024-05-05T21:03:10.26+00:00

    @Jelle Lippens

    You can user Graph chatMessageHostedContent API to retrieve hosted content for message in a channel

    GET /teams/{team-id}/channels/{channel-id}/messages/{message-id}/hostedContents/{hosted-content-id}
    GET /teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies/{reply-id}/hostedContents/{hosted-content-id}
    
    
    

    To get hosted content bytes for an image, use $value as below sample request

    GET https://graph.microsoft.com/v1.0/chats/19:2da4c29f6d7041eca70b638b43d45437@thread.v2/messages/1615971548136/hostedContents/aWQ9eF8wLXd1..V3cy9pbWdv/$value
    
    

    you can find more details here https://learn.microsoft.com/en-us/graph/api/chatmessagehostedcontent-get?view=graph-rest-1.0&tabs=http#example-2-get-hosted-content-bytes-for-an-image

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments