Forum Discussion
BoHyun
Sep 23, 2020Brass Contributor
How to send a stream video address in a message?
Greetings,
I want send message Microsoft Stream video link.
In Teams App, paste the MS Stream Video address into the message entry window.
This image is automatically created.
I want to send this using Graph API.
I tried with attachment, but I failed with message that id is not present in body.
var channel = await graphClient.Teams[pClassId].PrimaryChannel
.Request()
.GetAsync();
var chatMessage = new ChatMessage
{
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = ""
},
Attachments = new List<ChatMessageAttachment>()
{
new ChatMessageAttachment
{
ContentType = "reference",
ContentUrl = streamurl
}
}
};
resultChatMsg = await graphClient.Teams[pClassId].Channels[channel.Id].Messages
.Request()
.AddAsync(chatMessage);
How can I implement it?
Thank you for any help.
- Manish-MSFTMicrosoftPlease use following link to address this issue: https://docs.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http