Как отправить адаптивную карту json в api сервиса бота из внешнего источника? - PullRequest
0 голосов
/ 19 июня 2020

Как отправить адаптивную карту json на Azure API бота из внешнего источника?

[Добавлено 08.07.2020] enter image description here

Trying to send adaptive card json or content to api/notify to show custom messages ms teams.

Just trying to send the adaptive card from Azure Bot Service to MS Teams via channel created.Currently i have hard coded the details/links/text in source code (Azure Bot Services app). Would like to send the customized adaptive card each time by modifying the content of adaptive card.

Currently if i call the www.sampleAzurebotservices.com/api/notify the отображаются жестко закодированные данные. Надеюсь, это даст хорошее представление.

1 Ответ

1 голос
/ 26 июня 2020

@ Nanda, проверьте эту документацию для справки о том, как отправить сообщение боту. В документации есть текстовое сообщение, для адаптивной карты вы можете использовать нижеприведенный фрагмент кода.

var reply = MessageFactory.Attachment(new Attachment { ContentType = AdaptiveCard.ContentType, Content = adaptiveCard }); //pass adaptive card to content
var result = await turnContext.SendActivityAsync(reply, cancellationToken);

Сообщите мне, если у вас возникнут проблемы.

...