我正在尝试将我的应用程序与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"
}
}
}
在Raw 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 回答
问题似乎与followUpEventInput / outputContexts有关,删除它们是可选的,或者正确填充它们 .
WebHook Response Format