【问题标题】:How to make Zapier Webhooks work as fufillment in API.AI如何让 Zapier Webhooks 在 API.AI 中发挥作用
【发布时间】:2017-10-20 15:00:22
【问题描述】:

我正在试验 API.AI 代理。我希望通过 webhook 来实现对意图的响应。

我创建了一个将 Webhooks 捕获为触发器的 Zap。 “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 Assistant 模拟器中测试代理时,对意图的响应总是“对不起,代理名称现在不可用”

谁能指出我做错了什么?

【问题讨论】:

    标签: webhooks dialogflow-es zapier actions-on-google


    【解决方案1】:

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

    【讨论】:

    • 感谢您的回答!你知道任何其他自动化服务或类似的东西可以为非程序员管理响应数据吗?
    猜你喜欢
    • 2017-08-26
    • 2021-02-26
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 2023-01-23
    • 1970-01-01
    • 1970-01-01
    • 2016-05-14
    相关资源
    最近更新 更多