[Dialogflow]通过Webhook格式的更新权限(用于推送通知) [英] [Dialogflow]Update Permission through Webhook format (for push notifications)
问题描述
原始请求::我正在尝试根据文档实施推送通知: https://developers.google.com/actions/assistant/updates/notifications
ORIGINAL REQUEST: I'm trying to implement the push notifications following the documentation: https://developers.google.com/actions/assistant/updates/notifications
我正在使用带有Webhooks的Dialogflow(在PHP中),文档在nodeJS中给出了示例。
I'm using Dialogflow with webhooks (in PHP) and the documentation is giving example in nodeJS
现在,由于更新权限,我被封锁了,这是我的Webhook响应:
Right now, i'm blocked because of the Update permission, here's my Webhook response :
{
"source": "webhook",
"payload": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"UPDATE"
]
},
"updatePermission": {
"intent": "notification.simple.text"
}
}
}
}
}
进行模拟时,请允许我进行推送,但没有我指定的意图。
When I do the simulation, asks me a permission for a push, but not for the intent I specified.
我很确定问题是updatePermission,这一定是有问题的:
是字段名吗?
目的,我将我在对话流中填写的目的名称放进去,也许我必须执行使用动作?格式是否正确?
I'm quiet sure that the problem is the updatePermission, something must be wrong with that: Is it the field name? In intent, i put the intent name that i filled in dialogflow, maybe do i have to an use action? Is it in the good format ?
如果有人可以帮助我,或者只是给我一个关于更新许可的明确回应的示例。
If someone can help me or just give me an example of a clean response for an update permission.
谢谢!
解决方案
我才发现为什么,我的json不是好的,updatePermissionValueSpec必须放入数据对象中。
I just found why, my json wasn't good, the updatePermissionValueSpec must be into data object.
{
"source": "webhook",
"payload": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"UPDATE"
],
"updatePermissionValueSpec": {
"intent": "notification_simple_text"
}
}
}
}
}
}
推荐答案
我相信 updatePermission
应命名为 updatePermissionValueSpec
。
示例响应:
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "PLACEHOLDER"
}
}
]
},
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"UPDATE"
],
"updatePermissionValueSpec": {
"intent": "intent_name"
}
}
}
}
}
这篇关于[Dialogflow]通过Webhook格式的更新权限(用于推送通知)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!