Microsoft graph API method call to get content from content.body
I am writing a windows application that retrieves all messages and replies from MSTeams using the graphClient API using c#. I am using the method graphClient.Teams[TeamsID].Channels[ChannelID].Messages.GetAsync((requestConfiguration) to get the messages(not replies). I am trying to get (and store) the image embeded within the Body.Content return data. The method I am trying to use to get the image data is
graphClient.Teams[TeamsID].Channels[TeamsID].Messages[MessageID(from previous method return data)].HostedContents[Content-ID].GetAsync();
I know what the Value of the TeamsId,ChannelID and MessageID. I do not know what the value is for the Content-ID. The return data from the first API call contains data looking like the following.
“<p>Sep no jacket, no straps, weatherhead tied on</p>
<p><img alt=”Media” src=”https://graph.microsoft.com/v1.0/teams/02e7c74575f2/channels/x615tT4UI_UjDHEu1tx3mXiJ1wRtE1@thread.tacv2/messages/1723665375573/hostedContents/aWQ9LHR5cGU9MSx1cmw9aHR0cHM6Ly91cy1hcGkuYXNtLnNreXBlLmNvbS92MS9vYmplY3RzLzAtZXVzLWQxMS1hMGEyYTg4ZjhlNjlmN2RjZTFhYTE5YjIzNDM4Nzc1YS92aWV3cy9pbWdv/$value” width=”1920″ height=”2560″></p>”
The item highlighted in red is the MessageID
I’m looking for some documentation as to what this parameter is. Searching for a solution always points me to getting the contents using the chat methodology. This is not a chat, this is a message.
I am writing a windows application that retrieves all messages and replies from MSTeams using the graphClient API using c#. I am using the method graphClient.Teams[TeamsID].Channels[ChannelID].Messages.GetAsync((requestConfiguration) to get the messages(not replies). I am trying to get (and store) the image embeded within the Body.Content return data. The method I am trying to use to get the image data is graphClient.Teams[TeamsID].Channels[TeamsID].Messages[MessageID(from previous method return data)].HostedContents[Content-ID].GetAsync(); I know what the Value of the TeamsId,ChannelID and MessageID. I do not know what the value is for the Content-ID. The return data from the first API call contains data looking like the following. “<p>Sep no jacket, no straps, weatherhead tied on</p><p><img alt=”Media” src=”https://graph.microsoft.com/v1.0/teams/02e7c74575f2/channels/x615tT4UI_UjDHEu1tx3mXiJ1wRtE1@thread.tacv2/messages/1723665375573/hostedContents/aWQ9LHR5cGU9MSx1cmw9aHR0cHM6Ly91cy1hcGkuYXNtLnNreXBlLmNvbS92MS9vYmplY3RzLzAtZXVzLWQxMS1hMGEyYTg4ZjhlNjlmN2RjZTFhYTE5YjIzNDM4Nzc1YS92aWV3cy9pbWdv/$value” width=”1920″ height=”2560″></p>” The item highlighted in red is the MessageIDI’m looking for some documentation as to what this parameter is. Searching for a solution always points me to getting the contents using the chat methodology. This is not a chat, this is a message. Read More