繁体   English   中英

有没有办法在使用图表 api 创建团队选项卡时开始对话

[英]Is there a way to start conversation when teams tab is created using graph api

我正在创建一个teams app ,其中有一个选项可以通过提供选项卡显示标题、url 等详细信息来为个人/组创建一个new tab以进行协作创建选项卡后,我想发送一些支持消息来描述标签。

现在有按钮start conversation 当您单击按钮时,一些预填充的文本会与选项卡标题一起加载。

有没有一种方法可以使用graph api来实现这一点,所以我应该能够通过graph api传递支持消息,而不是单击开始对话按钮并获取预填充的消息?

或者我们可以自定义单击开始对话后显示的消息吗?

通过图形 api 在团队频道中创建选项卡后,您应该使用新选项卡的 ID 成功获得 201。

HTTP/1.1 201 Created
Content-type: application/json

{
  "id": "794f0e4e-4d10-4bb5-9079-3a465a629eff",
  "displayName": "My Contoso Tab",
  "configuration": {
    "entityId": "2DCA2E6C7A10415CAF6B8AB6661B3154",
    "contentUrl": "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/tabView",
    "websiteUrl": "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154",
    "removeUrl": "https://www.contoso.com/Orders/2DCA2E6C7A10415CAF6B8AB6661B3154/uninstallTab"
  },
  "sortOrderIndex": "20",
  "webUrl": "https://teams.microsoft.com/l/channel/19%3ac2e36757ee744c569e70b385e6dd79b6%40thread.skype/tab%3a%3afd736d46-51ed-4c0b-9b23-e67ca354bb24?label=my%20%contoso%to%tab"
}

然后您可以创建如下对话

POST https://graph.microsoft.com/v1.0/groups/29981b6a-0e57-42dc-94c9-cd24f5306196/conversations
Content-type: application/json

{
    "topic": "Take your wellness days and rest",
    "threads": [
        {
            "posts": [
                {
                    "body": {
                        "contentType": "html",
                        "content": "Contoso cares about you: Rest and Recharge"
                    },
                    "newParticipants": [
                        {
                            "emailAddress": {
                                "name": "Adele Vance",
                                "address": "AdeleV@contoso.onmicrosoft.com"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

参考文章

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM