---
# System prepended metadata

title: D8AI Webhook接收格式

---

# D8AI Webhook接收格式

## 說明

目前從D8AI 收到的機器人回覆,有兩包資料

未來可能會合併成一包

## 資料範例如下

1. 版本1
```json
{ 
  "events":[ 
    { 
      "chatObject":{ 
        "id":"d03cef25-0249-4314-9cfa-8208b8e4abaf",
        "from":"cb-2",
        "roomId":"aac7561e-97ff-4204-9b3c-a876687fcf85",
        "timeStamp":1581668804371
      },
      "to":{ 
        "userId":"tp-2-native-8fcc179e-302e-4d80-9719-e61df2163a1c"
      },
      "messages":[ 
        { 
          "type":"text",
          "text":"請再說一次",
          "extensions":{ 
            "showFeedbackButtons":false
          }
        }
      ]
    }
  ]
}
```
2. 版本2
```json
{ 
  "events":[ 
    { 
      "chatObject":{ 
        "id":"87cd4844-c258-4630-a948-ba9663bc69ba",
        "from":"cb-2",
        "roomId":"aac7561e-97ff-4204-9b3c-a876687fcf85",
        "timeStamp":1581668671779
      },
      "to":{ 
        "userId":"tp-2-native-8fcc179e-302e-4d80-9719-e61df2163a1c"
      },
      "messages":[ 
        { 
          "$parent":{ 
            "timeStamp":1581668671779,
            "from":"cb-2",
            "_id":"87cd4844-c258-4630-a948-ba9663bc69ba",
            "roomId":"aac7561e-97ff-4204-9b3c-a876687fcf85",
            "content":{ 
              "type":"TEXTCARD",
              "headerText":"試試其他問題",
              "bodyText":"",
              "actions":[ 
                { 
                  "type":"message",
                  "label":"G9或BB轉HNRB",
                  "text":"G9或BB轉HNRB"
                },
                { 
                  "type":"message",
                  "label":"保單解約",
                  "text":"保單解約"
                },
                { 
                  "type":"message",
                  "label":"業務通路版",
                  "text":"業務通路版"
                }
              ],
              "traceId":914,
              "withVoice":false
            },
            "created_at":"2020-02-14T08:24:31.781Z",
            "updated_at":"2020-02-14T08:24:31.781Z",
            "__v":0
          },
          "$isSingleNested":true,
          "$__":{ 
            "strictMode":false,
            "selected":{ 

            },
            "getters":{ 

            },
            "wasPopulated":false,
            "activePaths":{ 
              "paths":{ 
                "type":"require"
              },
              "states":{ 
                "ignore":{ 

                },
                "default":{ 

                },
                "init":{ 

                },
                "modify":{ 

                },
                "require":{ 
                  "type":true
                }
              },
              "stateNames":[ 
                "require",
                "modify",
                "init",
                "default",
                "ignore"
              ]
            },
            "pathsToScopes":{ 

            },
            "cachedRequired":{ 

            },
            "session":null,
            "$setCalled":{ 

            },
            "ownerDocument":{ 
              "timeStamp":1581668671779,
              "from":"cb-2",
              "_id":"87cd4844-c258-4630-a948-ba9663bc69ba",
              "roomId":"aac7561e-97ff-4204-9b3c-a876687fcf85",
              "content":{ 
                "type":"TEXTCARD",
                "headerText":"試試其他問題",
                "bodyText":"",
                "actions":[ 
                  { 
                    "type":"message",
                    "label":"G9或BB轉HNRB",
                    "text":"G9或BB轉HNRB"
                  },
                  { 
                    "type":"message",
                    "label":"保單解約",
                    "text":"保單解約"
                  },
                  { 
                    "type":"message",
                    "label":"業務通路版",
                    "text":"業務通路版"
                  }
                ],
                "traceId":914,
                "withVoice":false
              },
              "created_at":"2020-02-14T08:24:31.781Z",
              "updated_at":"2020-02-14T08:24:31.781Z",
              "__v":0
            },
            "emitter":{ 
              "_events":{ 

              },
              "_eventsCount":0,
              "_maxListeners":0
            },
            "$options":{ 
              "isNew":true
            },
            "validating":null
          },
          "isNew":false,
          "_doc":{ 
            "type":"TEXTCARD",
            "headerText":"試試其他問題",
            "bodyText":"",
            "actions":[ 
              { 
                "type":"message",
                "label":"G9或BB轉HNRB",
                "text":"G9或BB轉HNRB"
              },
              { 
                "type":"message",
                "label":"保單解約",
                "text":"保單解約"
              },
              { 
                "type":"message",
                "label":"業務通路版",
                "text":"業務通路版"
              }
            ],
            "traceId":914,
            "withVoice":false
          },
          "$locals":{ 

          },
          "headerText":"試試其他問題",
          "bodyText":"",
          "actions":[ 
            { 
              "type":"message",
              "label":"G9或BB轉HNRB",
              "text":"G9或BB轉HNRB"
            },
            { 
              "type":"message",
              "label":"保單解約",
              "text":"保單解約"
            },
            { 
              "type":"message",
              "label":"業務通路版",
              "text":"業務通路版"
            }
          ],
          "traceId":914,
          "withVoice":false,
          "type":"textCard"
        }
      ]
    }
  ]
}
```