向MS Teams Channel发送主动式自适应卡消息 [英] Send Proactive Adaptive Card Message to MS Teams Channel

查看:53
本文介绍了向MS Teams Channel发送主动式自适应卡消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图将带有按钮的主动式自适应消息卡发送到MS TEAMS中的某个频道,但是我找不到任何解决方案.

REST API(

解决方案

根据希尔顿的建议,我可以弄清楚这一点

您可以在此处设计自己的自适应卡:自适应卡设计并编辑 attachments.body根据您的要求.

发送主动消息

方法:POST网址: https://smba.trafficmanager.net/{api}/v3/conversations/{channelId}/activities

以漫游器发送回复

方法:POST网址: https://smba.trafficmanager.net/{api}/v3/conversations/{channelId}; messageid = {messageid}/活动

  {"type":消息",附件":[{"contentType":"application/vnd.microsoft.card.adaptive",内容": {"type":"AdaptiveCard","version":"1.0",身体": [{"type":"TextBlock","size":"Medium","weight":"Bolder","text":"text"},{"type":"TextBlock","size":"small","text":"text","wrap":正确},],动作":[{"type":"Action.Submit","title":"Accept",数据": {接受":正确}},{"type":"Action.Submit","id":"id","title":"title",数据": {"msteams":{"type":任务/提取",}}}]}}]} 

I have been trying to send proactive adaptive message card with buttons to a channel in MS TEAMS, but I am not able to find any solution to this.

Any solution in REST API (https://smba.trafficmanager.net) or BotBuilder SDK for nodejs is appreciated.

解决方案

Based on recommendation from Hilton , I could figure out this

You could design your own adaptive card here: Adaptive Card Design and edit attachments.body as per your requirement.

sending a proactive message

METHOD: POST URL: https://smba.trafficmanager.net/{api}/v3/conversations/{channelId}/activities

sending reply as bot

METHOD: POST URL: https://smba.trafficmanager.net/{api}/v3/conversations/{channelId};messageid={messageid}/activities

{   
    "type": "message",
    "attachments": [
        {
       "contentType": "application/vnd.microsoft.card.adaptive",
       "content": {
        "type": "AdaptiveCard",
        "version": "1.0",
        "body": [
            {
                "type": "TextBlock",
                "size": "Medium",
                "weight": "Bolder",
                "text": "text"
            },
            {
                "type": "TextBlock",
                "size": "small",
                "text": "text",
                "wrap": true
            },
         ],
        "actions": [
            {
                "type": "Action.Submit",
                "title": "Accept",
                "data": {
                    "accept": true
                }
            },
            {
                "type": "Action.Submit",
                 "id": "id",
                  "title": "title",
                  "data": {
                    "msteams": {
                      "type": "task/fetch",
                    }
                  }
            }]
        }
        }
    ]
}

这篇关于向MS Teams Channel发送主动式自适应卡消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆