簡體   English   中英

如何使用 IBM Watson Assistant 對話框執行 Messenger Facebook 的通用模板

[英]How to do Generic Template of messenger Facebook with IBM Watson Assistant Dialog

我有一個來自 IBM Watson 的工作助手我想將多個選項顯示為圖像、描述和鏈接組合,此功能可用於通用模板下的 Messenger,但我在對話響應中找不到可以讓我執行此圖像的選項

{
"output": {
    "generic": [
        {
            "values": [
                {
                    "text": "I got that"
                }
            ],
            "response_type": "text",
            "selection_policy": "sequential"
        }
    ],
    "facebook": {
        "message": {
            "attachment": {
                "type": "template",
                "payload": {
                    "template_type": "generic",
                    "elements": [
                        {
                            "title": "Welcome!",
                            "image_url": "https://petersfancybrownhats.com/company_image.png",
                            "subtitle": "We have the right hat for everyone.",
                            "default_action": {
                                "type": "web_url",
                                "url": "https://petersfancybrownhats.com/view?item=103",
                                "webview_height_ratio": "tall"
                            },
                            "buttons": [
                                {
                                    "type": "web_url",
                                    "url": "https://petersfancybrownhats.com",
                                    "title": "View Website"
                                },
                                {
                                    "type": "postback",
                                    "title": "Start Chatting",
                                    "payload": "DEVELOPER_DEFINED_PAYLOAD"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}

}

我在對話節點上使用了這個 JSON 沒有成功

If any one is facing the same problem you should do it as output.integrations.facebook not output.facebook

所以 object 會像那樣

{
"output": {
    "generic": [
        {
            "values": [
                {
                    "text": "I got that"
                }
            ],
            "response_type": "text",
            "selection_policy": "sequential"
        }
    ],
    "facebook": {
        "message": {
            "attachment": {
                "type": "template",
                "payload": {
                    "template_type": "generic",
                    "elements": [
                        {
                            "title": "Welcome!",
                            "image_url": "https://petersfancybrownhats.com/company_image.png",
                            "subtitle": "We have the right hat for everyone.",
                            "default_action": {
                                "type": "web_url",
                                "url": "https://petersfancybrownhats.com/view?item=103",
                                "webview_height_ratio": "tall"
                            },
                            "buttons": [
                                {
                                    "type": "web_url",
                                    "url": "https://petersfancybrownhats.com",
                                    "title": "View Website"
                                },
                                {
                                    "type": "postback",
                                    "title": "Start Chatting",
                                    "payload": "DEVELOPER_DEFINED_PAYLOAD"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM