Sending Teams Message

Hi,

 

I have begun playing with the web service integration capabilities within a process to send a message to a Teams channel. Obviously many use cases exist for having a message sent to a Team channel.

 

I have been able to successfully send a message to a channel, however I am having issues in managing the formatting of the message, so a clear title, and message body structure can be provided. Has anyone got any integration working with Teams that would be prepared to share how the web service, variables etc. are configured to allow formatted messages to be sent?

 

Thanks in advance.

Like 0

Like

6 comments

no one has?

 

Any guidance would be appreciated

Mark Roberts,



Could you please share how the implementation is done currently?

Also, have you tried about the content using <HTML>







BR,

Bhoobalan Palanivelu

 

Bhoobalan Palanivelu writes:

Mark Roberts,

Could you please share how the implementation is done currently?

Also, have you tried about the content using <HTML>

BR,

Bhoobalan Palanivelu

 

hi Mark Roberts,



Using the Content type as HTML  depicted below.

GraphServiceClient graphClient = new GraphServiceClient( authProvider );
 
var chatMessage = new ChatMessage
{
	Body = new ItemBody
	{
		ContentType = BodyType.Html,
		Content = "{\r\n  \"title\": \"This is an example of posting a card\",\r\n  \"subtitle\": \"&lt;h3&gt;This is the subtitle&lt;/h3&gt;\",\r\n  \"text\": \"Here is some body text. &lt;br&gt;\\r\\nAnd a &lt;a href=\\\"http://microsoft.com/\\\"&gt;hyperlink&lt;/a&gt;. &lt;br&gt;\\r\\nAnd below that is some buttons:\",\r\n  \"buttons\": [\r\n    {\r\n      \"type\": \"messageBack\",\r\n      \"title\": \"Login to FakeBot\",\r\n      \"text\": \"login\",\r\n      \"displayText\": \"login\",\r\n      \"value\": \"login\"\r\n    }\r\n  ]\r\n}",	}
};
 
await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages
	.Request()
	.AddAsync(chatMessage);





BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

Hi

 

Thanks for your reply. This is what I have done so far:

 

1. Created a new Web Service entry

2. Configured a single Method and populated top fields. I know this is correct as I can successful send a test request with just a single parameter line and it was received and displayed in my Teams channel

3. The issue I have is with the configuration of the Parameters, for which all but contentType I assume are Body parameters. The following screenshot is me playing with various structures and content entries, but I cannot get anything working :/

 

 

I am trying to send a message in a form similar to the following:

 

https://adaptivecards.io/samples/ActivityUpdate.html

 

I feel I am missing something straightforward in how this should be built within the Creatio Web Service definition, but the docs are not helping find it.

 

thanks

 

Mark

did you ever get this working?

keith schmitt,

No, I have been distracted with other things, so not got back to this. This would be a great blog for someone to write up and share!

Show all comments