Home

Teams REST API : Post Conversation message to Teams app

%3CLINGO-SUB%20id%3D%22lingo-sub-286381%22%20slang%3D%22en-US%22%3ETeams%20REST%20API%20%3A%20Post%20Conversation%20message%20to%20Teams%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-286381%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20did%20a%20POC%20on%20posting%20message%20to%20Teams%20app%20and%20found%20that%20we%20can%20only%20post%20'message%20body'%20of%20the%20chat%20and%20not%20its%20%3CSTRONG%3ESubject%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20we%20use%20the%20API%20to%20post%20Message%20body%20along%20with%20its%20Subject%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Esource%20%3A%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fchannel_post_chatthreads%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ECreating%20a%20chat-thread%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-286381%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EConversations%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHow-to%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287133%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20REST%20API%20%3A%20Post%20Conversation%20message%20to%20Teams%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287133%22%20slang%3D%22en-US%22%3EWell%20subject%20should%20be%20outside%20the%20body%20but%20still%20doesn%E2%80%99t%20work%20either%20way.%20Guess%20it%E2%80%99s%20still%20limited%20right%20now.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287045%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20REST%20API%20%3A%20Post%20Conversation%20message%20to%20Teams%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287045%22%20slang%3D%22en-US%22%3EWell%20I%20tried%20passing%20'subject'%20as%20a%20property%20as%20well.%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22rootMessage%22%3A%20%7B%3CBR%20%2F%3E%22body%22%3A%20%7B%3CBR%20%2F%3E%22contentType%22%3A%201%2C%3CBR%20%2F%3E%22content%22%3A%20%22%3CH1%20id%3D%22toc-hId-354631224%22%3EHello%20world%3C%2FH1%3E%22%2C%3CBR%20%2F%3E%22subject%22%3A%20%22New%20Subject%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20that%20did%20not%20work.%20API%20is%20still%20just%20accepting%20the%20property%20'content'%20and%20displaying%20it%20as%20message-body%20and%20it%20is%20ignoring%20the%20property%20'subject'.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-286675%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20REST%20API%20%3A%20Post%20Conversation%20message%20to%20Teams%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-286675%22%20slang%3D%22en-US%22%3EWell%2C%20I'm%20trying%20to%20get%20it%20to%20work%20myself%20and%20it%20doesn't%20seem%20to%20work%20%3AP.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-286653%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20REST%20API%20%3A%20Post%20Conversation%20message%20to%20Teams%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-286653%22%20slang%3D%22en-US%22%3EAccording%20to%20this%2C%20the%20type%20includes%20subject%2C%20you%20should%20be%20able%20to%20referencing%20in%20the%20post.%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fresources%2FchatMessage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fresources%2FchatMessage%3C%2FA%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

We did a POC on posting message to Teams app and found that we can only post 'message body' of the chat and not its Subject.

 

Can we use the API to post Message body along with its Subject?

 

source :  Creating a chat-thread

4 Replies
Highlighted
According to this, the type includes subject, you should be able to referencing in the post. https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/chatMessage
Highlighted
Well, I'm trying to get it to work myself and it doesn't seem to work :P.
Highlighted
Well I tried passing 'subject' as a property as well.

{
"rootMessage": {
"body": {
"contentType": 1,
"content": "<h1>Hello world</h1>",
"subject": "New Subject"
}
}
}

But that did not work. API is still just accepting the property 'content' and displaying it as message-body and it is ignoring the property 'subject'.
Highlighted
Well subject should be outside the body but still doesn’t work either way. Guess it’s still limited right now.