Get hosted content Stream within MS Teams message in the latest version of Graph API #2627
Unanswered
EUNDERWO04
asked this question in
Q&A
Replies: 1 comment
-
Any chance you can share the details of the error/exception you are experiencing here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the newest Graph SDK (5.56.0), I am trying to get the content of the image stored within the channel message (body.content). My customers paste images into the message and are not using attachments.
I am making this method call which is failing.
var result6 = await graphClient.Teams[str_TeamsID].Channels[ChannelID.ToString()].Messages[ChannelMessageID.ToString()].HostedContents[hostedContentId].Content.GetAsync();
The parameter hostedContentId was retrieved using the method call
var result5 = await graphClient.Teams[str_TeamsID].Channels[ChannelID.ToString()].Messages[ChannelMessageID.ToString()].HostedContents.GetAsync();
which works.
The method
graphClient
.Teams[TeamsId]
.Channel[ChannelID]
.Messages[messageId]
.HostedContents[hostedContentId].Content.GetAsync()
Throws an exception error.
I tried the following work around code:
var requestInformation = graphClient.Teams[str_TeamsID].Channels[ChannelID.ToString()].Messages[ChannelMessageID.ToString()].HostedContents[hostedContentId].ToGetRequestInformation(); // works
requestInformation.URI = new Uri(requestInformation.URI.OriginalString + "/$value"); // works
var streamResponse = await graphClient.RequestAdapter.SendPrimitiveAsync(requestInformation); // fails
and got basically the same error message.
Is the following method not working?
graphClient
.Teams[TeamsId]
.Channel[ChannelID]
.Messages[messageId]
.HostedContents[hostedContentId].Content.GetAsync()
How can I retrieve the hosted contents?
Beta Was this translation helpful? Give feedback.
All reactions