web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Getting hostedContents...
Power Automate
Unanswered

Getting hostedContents value from Teams channel message using Graph API

(1) ShareShare
ReportReport
Posted on by 287
Hello community,
 
I am trying to get the contents (images) of a Teams channel message in Power Apps / Power Automate. I have been following the documentation provided here: https://learn.microsoft.com/en-us/graph/api/chatmessagehostedcontent-get?view=graph-rest-1.0&tabs=http
 
Using the Graph Explorer to get the hosted contents works fine:



I am using the Teams HTTP connector in Power Automate. When I enter the same URL in there with the Content-Type as image/png (which is the actual content type), I get this error:

 
Everything works fine in Power Automate until I use the /$value parameter. What could be the mistake here and how do I fix it?

Error: Http request failed as the content was not valid: 'Unable to translate bytes [89] at index 0 from specified code page to Unicode.'.
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at
    Have you tried the application/json Content-Type header instead in your Teams action to see if it returns the contentbytes and content type? 
  • AP-06101159-0 Profile Picture
    2 on at
    I'm running in to the same issue, with Content-Type header set to json or image. Hope somebody has a solution. 
  • Amardeep Raj Profile Picture
    18 on at
    Hi
     
    This is the permission issue you need to appropriate permission for this according to doc.
    Get chatMessageHostedContent - Microsoft Graph v1.0 | Microsoft Learn
    • Graph API Permissions: Reading chat messages requires specific Graph API permissions.
    • Admin Consent Needed: The permission "ChannelMessage.Read.All" requires admin consent.
    • No Direct Access via Teams Connector: You cannot access hosted message content directly through the Teams HTTP connector.
    • Steps to Follow:
      1. Register Application: Register your app in Azure Active Directory (AAD).
      2. Grant Permissions: Assign the necessary permissions to your app.
      3. Create Custom Connector: Set up a custom connector for authentication.
      4. Access Endpoint: Use the endpoint directly through the custom connector.
     
     
     
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
  • AB-06120138-0 Profile Picture
    2 on at
    were you able to make it work?
  • Suggested answer
    gbb Profile Picture
    Microsoft Employee on at

    This should be fixed for allowed paths for the connector. Please try it again.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard