簡體   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