Dialogflow V2始终会出现此错误:-Webhook调用失败。错误:Webhook响应为空

时间:2018-10-01 14:07:33

标签: integration webhooks dialogflow

我试图将我的应用程序与Dialogflow集成在一起,并将请求发送到Mulesoft,然后从那里以Webhook指南中提到的格式发送响应。

下面是诊断信息中显示的API请求和响应:-

履行请求:-

{
 "responseId": "da851e5f-b6c3-4a17-bfdf-ad935d5003f6",
"queryResult": {
"queryText": "Open the report opportunity by Type where Type equals to New Customer",
"parameters": {
  "reportName": "opportunity by Type",
  "filterField": "Type",
  "filterOperator": "equals",
  "filterValue": "New Customer"
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Displaying the report opportunity by Type where Type equals New Customer",
"fulfillmentMessages": [
  {
    "platform": "ACTIONS_ON_GOOGLE",
    "simpleResponses": {
      "simpleResponses": [
        {
          "textToSpeech": "Displaying the report opportunity by Type where Type equals New Customer"
        }
      ]
    }
  },
  {
    "platform": "ACTIONS_ON_GOOGLE",
    "simpleResponses": {
      "simpleResponses": [
        {
          "textToSpeech": "Displaying the requested report on CRM"
        }
      ]
    }
  },
  {
    "text": {
      "text": [
        "Displaying the report opportunity by Type where Type equals New Customer"
      ]
    }
  }
],
"intent": {
  "name": "projects/sfdcconnect-68886/agent/intents/ef6d8d78-4dbf-4fb5-b647-4b427ca4dfa5",
  "displayName": "show.report"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
 },
"originalDetectIntentRequest": {
"payload": {}
 },
 "session": "projects/sfdcconnect-68886/agent/sessions/4c9c3310-52ab-dbb5-73a8-b104ba55676e"
 }

履行响应:-

{
"fulfillmentText": "This is a text response from Mulesoft",
"fulfillmentMessages": [
{
  "card": {
    "title": "card title",
    "subtitle": "card text",
    "imageUri": "https://assistant.google.com/static/images/molecule/Molecule-Formation-stop.png",
    "buttons": [
      {
        "text": "button text",
        "postback": "https://assistant.google.com/"
      }
    ]
  }
}
],
"source": "example.com",
"payload": {
"google": {
  "expectUserResponse": true,
  "richResponse": {
    "items": [
      {
        "simpleResponse": {
          "textToSpeech": "this is a simple response from Mulesoft"
        }
      }
    ]
  }
  },
  "facebook": {
  "text": "Hello, Facebook!"
  },
  "slack": {
  "text": "This is a text response for Slack."
}
 },
"outputContexts": [
{
  "name": "projects/sfdcconnect-68886/agent/sessions/4c9c3310-52ab-dbb5-73a8-b104ba55676e/contexts/context name",
  "lifespanCount": 5,
  "parameters": {
    "param": "param value"
  }
}
 ],
"followupEventInput": {
"name": "event name",
"languageCode": "en-US",
"parameters": {
  "param": "param value"
  }
 }
 }

在原始API响应下:-

"webhookStatus": {
"code": 3,
"message": "Webhook call failed. Error: Webhook response was empty."
}

实现状态:-

Webhook call failed. Error: Webhook response was empty.

我浏览了多篇文章,并验证了JSOn响应也是正确的。还尝试删除现有项目并创建一个新项目。

在Google操作中对此进行测试时,由于该错误,它也在下面显示了以下错误:-

  MalformedResponse
  'final_response' must be set.

有什么办法可以解决此错误。

正在Mulesoft端执行操作并发送响应,只是它无法在textToSpeech部分下显示对Google操作/对话框的响应。

关于, 拉贾特

1 个答案:

答案 0 :(得分:0)

问题似乎出在followUpEventInput / outputContexts上,将它们删除为可选的,或者正确地填充它们。

WebHook Response Format