我发送了一个json消息,要求对Google进行动作推送通知(对话框)
totototo是我具有向我发送用户ID的Google助手许可的意图的名称。
这是我发送的json:
{
"customPushMessage": {
"userNotification": {
"title": "totototo",
"text": "Simple Text"
},
"target": {
"userId": "ABwppHG0NJdKbS4wz__dL2Rlj6grOkJ9LfyGk2XDgW2Z960AwGR7znl5pX1rM76ffaZKkoOAO",
"intent": "totototo",
"locale": "fr-CA"
}
}, "isInSandbox": "true"
}
我也尝试过使用此json,但我遇到了相同的错误:
{
"customPushMessage": {
"userNotification": {
"title": "totototo",
"text": "Simple Text"
},
"target": {
"userId": "ABwppHG0NJdKbS4wz__dL2Rlj6grOkJ9LfyGk2XDgW2Z960AwGR7znl5pX1rM76ffaZKkoOAO",
"intent": "totototo",
"locale": "fr-CA"
}
}
}
这是我收到的错误:
{
"error":{
"code":400,
"message":"Invalid JSON payload received. Unknown name \"{ \"customPushMessage\": { \"userNotification\": { \"title\": \"totototo\", \"text\": \"Simple Text\" }, \"target\": { \"userId\": \"ABwppHG0NJdKbS4wz__dL2Rlj6grOkJ9LfyGk2XDgW2Z960AwGR7znl5pX1rM76ffaZKkoOAO\", \"intent\": \"totototo\", \"locale\": \"fr-CA\" } }, \"isInSandbox\": \"true\"}\": Cannot bind query parameter. Field '{ \"customPushMessage\": { \"userNotification\": { \"title\": \"totototo\", \"text\": \"Simple Text\" }, \"target\": { \"userId\": \"ABwppHG0NJdKbS4wz__dL2Rlj6grOkJ9LfyGk2XDgW2Z960AwGR7znl5pX1rM76ffaZKkoOAO\", \"intent\": \"totototo\", \"locale\": \"fr-CA\" } }, \"isInSandbox\": \"true\"}' could not be found in request message.",
"status":"INVALID_ARGUMENT",
"details":[
{
"@type":"type.googleapis.com/google.rpc.BadRequest",
"fieldViolations":[
{
"description":"Invalid JSON payload received. Unknown name \"{ \"customPushMessage\": { \"userNotification\": { \"title\": \"totototo\", \"text\": \"Simple Text\" }, \"target\": { \"userId\": \"ABwppHG0NJdKbS4wz__dL2Rlj6grOkJ9LfyGk2XDgW2Z960AwGR7znl5pX1rM76ffaZKkoOAO\", \"intent\": \"totototo\", \"locale\": \"fr-CA\" } }, \"isInSandbox\": \"true\"}\": Cannot bind query parameter. Field '{ \"customPushMessage\": { \"userNotification\": { \"title\": \"totototo\", \"text\": \"Simple Text\" }, \"target\": { \"userId\": \"ABwppHG0NJdKbS4wz__dL2Rlj6grOkJ9LfyGk2XDgW2Z960AwGR7znl5pX1rM76ffaZKkoOAO\", \"intent\": \"totototo\", \"locale\": \"fr-CA\" } }, \"isInSandbox\": \"true\"}' could not be found in request message."
}
]
}
]
}
}
您知道问题出在哪里吗?
谢谢