无法发送丰富的messege到dialogflow的行

时间:2018-07-08 11:09:20

标签: json line dialogflow

作为标题,我想知道如何从对话框流向行发送诸如轮播,按钮,图像等丰富的消息。我试图填充Costum有效负载。但是我一直无法在线响应(我在检查诊断信息时确实得到响应) 我的costum负载就是这样..from the dialogflow docs

 {
  "type": "template",
  "altText": "this is a buttons template",
  "template": {
    "type": "buttons",
    "thumbnailImageUrl": "https://example.com/bot/images/image.jpg",
    "title": "Menu",
    "text": "Please select",
    "actions": [
      {
        "type": "postback",
        "label": "Buy",
        "data": "action=buy&itemid=123"
      },
      {
        "type": "postback",
        "label": "Add to cart",
        "data": "action=add&itemid=123"
      },
      {
        "type": "uri",
        "label": "View detail",
        "uri": "http://example.com/page/123"
      }
    ]
  }
}

可能是因为在诊断信息时(在dialogflow上)当我得到回复时有一个有效载荷密钥...?我可以摆脱有效载荷密钥吗?.. c

 {
        "payload": {
          "template": {
            "imageBackgroundColor": "#FFFFFF",
            "imageSize": "cover",
            "imageAspectRatio": "rectangle",
            "defaultAction": {
              "label": "View detail",
              "type": "uri",
              "uri": "http://example.com/page/123"
            },
            "actions": [
              {
                "type": "postback",
                "label": "Buy",
                "data": "action=buy&itemid=123"
              },
              {
                "label": "Add to cart",
                "data": "action=add&itemid=123",
                "t

感谢您的帮助:D

1 个答案:

答案 0 :(得分:0)

只要找出答案, 您应该输入“ line”键和whoalaa ..它现在可以使用了,

{
  "line": {
  "type": "template",
  "altText": "this is a carousel template",
  "template": {
    "type": "carousel",
    "columns": [
      {
        "thumbnailImageUrl": "https://example.com/bot/images/item1.jpg",
        "imageBackgroundColor": "#FFFFFF",
        "title": "this is menu",
        "text": "description",
        "defaultAction": {