首页 文章

如何让Zapier Webhooks在API.AI中发挥作用

提问于
浏览
0

我正在试验API.AI代理 . 我希望webhooks能够实现对意图的回应 .

我创建了一个Zap,将Webhooks作为触发器 . "Catch hook"触发器给了我一个URL,例如我在API.AI履行中输入的https://hooks.zapier.com/hooks/catch/1111111/9aaaaa/ . API.AI正确地将JSON发送到此URL,并触发Zap,接收以下示例JSON:

result__fulfillment__messages:	speech: 
type: 0
id:	8551d99c-1ce9-4a0c-b24e-27d4c2090dbf
result__actionIncomplete:	False
result__action:	Trip-recommendations
result__resolvedQuery:	all inclusive
result__metadata__intentId:	314e8e2f-312f-4ebd-93e1-c92da8648725
result__metadata__webhookForSlotFillingUsed:	false
status__code:	200
timestamp:	2017-05-16T00:04:37.773Z
result__metadata__intentName:	trip-recommendations
result__parameters__trip-who:	family
result__parameters__trip-interest:	all inclusive
status__errorType:	success
lang:	en
result__score:	1.0
result__source:	agent
result__metadata__webhookUsed:	true
sessionId:	e28bd01f-2852-4c0c-98d8-ea03d58d87fa
Fields with no value:
result__parameters__trip-destinations
result__fulfillment__speech
result__contexts
result__speech
result__parameters__trip-recomendation-Country
result__parameters__date
result__parameters__unit-currency
result__parameters__date-period

现在我试图在Zap的第二步发送响应,以便我的API.AI代理使用webhook的响应作为意图的实现 .

为此,我使用以下参数将Zap的第二步配置为Webhooks自定义请求操作:

unflatten:	yes
url:	https://hooks.zapier.com/hooks/catch/1111111/9aaaaa/ 
    "fulfillment": {
  "speech": "Today in Boston: Fair, the temperature is 37 F",
  "source": "apiai-weather-webhook-sample",
  "displayText": "Today in Boston: Fair, the temperature is 37 F"
}
method:	POST
pass_through:

但是当我在Google智能助理模拟器中测试代理时,对意图的响应总是“我很抱歉,代理名称现在不可用”

有谁能指出我做错了什么?

1 回答

  • 0

    Zapier的webhook触发器始终使用包含相同状态相关属性集的JSON有效负载进行响应(基本上是收到webhook请求的确认,仅此而已) . 不幸的是,无法改变响应数据 .

相关问题