Dialogflow V2 Messenger与多条消息的集成 [英] Dialogflow V2 Messenger Integration with Multiple Messages

查看:209
本文介绍了Dialogflow V2 Messenger与多条消息的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在一个Webhook调用Dialogflow中发送多个消息,该消息将传递给Messenger。现在,我的Webhook会以一个错误的JSON正文进行响应:

I am trying to send to multiple messages within one Webhook call to Dialogflow, which shall be passed to Messenger. Right now my Webhook responds with a malfunctioning JSON body:

{
    'fulfillmentText': "Text",
    'fulfillmentMessages': [{
        "platform": "facebook",
        "text": [{
            "text": "Text"
        }]
    }],
    'source': "facebook"
}

何时我通过Messenger测试了Webhook,看到正在输入符号,但是从没有收到 Text 消息。从Dialogflow控制台测试相同的Webhook时,我得到

When I test the Webhook via Messenger I see the is typing symbol, but never receive the Text message. While testing the same Webhook from the Dialogflow Console I get


Webhook执行成功

Webhook execution successful

已返回。我想我缺少一些JSON字段来告诉Dialogflow它必须以哪种格式向JSON发送两个Messenger API。有人对如何解决此问题有任何线索吗?

returned. I guess I am missing some JSON fields to tell Dialogflow in which format it has to send the JSON two the Messenger API. Anybody having any clues on how to solve this issue?

编辑:
我最新的无效试用版...

My latest not working trial...

{
  "fulfillmentText": "Hola!",
  "fulfillmentMessages": [
    {
      "text": {
        "text": [
          "Title: this is a title"
        ]
      },
      "platform": "FACEBOOK"
    },
    {
      "text": {
        "text": [
          "Title: this is a title"
        ]
      },
      "platform": "FACEBOOK"
    }
  ]
}


推荐答案

我邮寄了有关此问题的Dialogflow支持,事实证明当前无法发送多个来自网络挂钩的消息。

I mailed the Dialogflow support about this issue and it turns out that it is currently not possible to send multiple messages from a webhook.


可以直接从webhook发送顺序消息
。但是,如果您使用的是支持丰富消息的一键式
集成之一,则可以调用
中的意图,该意图是通过事件从webhook定义为多条消息,如$ b中所述,如
https://dialogflow.com/docs/events#invoking_event_from_webhook

At this point, it's not possible to send sequential messages directly from webhook. However, if you are using one of our one-click integrations that support rich messages, you can invoke intents in which multiple messages are defined from webhook through an event as described at https://dialogflow.com/docs/events#invoking_event_from_webhook.

让我知道您是否有任何疑问。

Let me know if you have any questions.

关于Dialogflow的Ankita

Regards, Ankita from Dialogflow

这篇关于Dialogflow V2 Messenger与多条消息的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆