原始请求:我正在尝试按照文档实现推送通知:https://developers.google.com/actions/assistant/updates/notifications
我正在使用带有webhooks的Dialogflow (用PHP编写),文档是用nodeJS编写的示例
现在,由于更新权限,我被阻止了,这是我的Webhook响应:
{
"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"
}
}
}
}
}
当我进行模拟时,会询问我推送的权限,但不是出于我指定的意图。
我非常确定问题出在updatePermission上,一定是出了什么问题:是字段名吗?在intent中,我将我填写的intent名称放在了dialogflow中,也许我必须使用操作?它的格式好吗?
如果有人可以帮助我,或者只是给我一个更新权限的干净响应的例子。
谢谢!
解决方案
我刚刚找到原因了,我的json不好,updatePermissionValueSpec必须是数据对象。
{
"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"
}
}
}
}
}
}
发布于 2018-06-07 04:25:50
我认为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"
}
}
}
}
}
https://stackoverflow.com/questions/50725790
复制相似问题