Missing payload in QUERY response
See original GitHub issueHello,
tell me guys, what is wrong with my QUERY response. Because I looked at it and found nothing but Google Console tells that I am missing payload field.
Error message from Google Cloud:
{ "insertId": "166g06lg15lgekt", "jsonPayload": { "executionLog": { "executionResults": [ { "actionResults": [ { "action": { "actionType": "STATE_QUERY" }, "device": { "deviceType": "OUTLET" }, "status": { "externalDebugString": "JSON payload not an object.", "isSuccess": false, "statusType": "PARTNER_RESPONSE_INVALID_PAYLOAD" } } ], "executionType": "PARTNER_CLOUD", "latencyMsec": "191", "requestId": "4734217757620110233" } ] }, "locale": "en-US" }, "logName": "projects/smartlightproject-f47f4/logs/assistant_smarthome%2Fassistant_smarthome_logs", "receiveTimestamp": "2022-07-13T13:23:04.088211105Z", "resource": { "labels": { "project_id": "smartlightproject-f47f4" }, "type": "assistant_action_project" }, "severity": "ERROR", "timestamp": "2022-07-13T13:23:04.088211105Z" }
And my QUERY response:
{ "requestId": "4734217757620110233", "payload": { "devices": { "123": { "on": "true", "online": "true" } } } }
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
@slaesh, my friend, you are a genious! I managed to try your solution anyway and it worked! I totally don’t know why this happened but when I passed string JSON to Ok method I got intended action and no error. I really really appreciate your suggestion, it saved me life 😃. Now with a cool heart I can close issue. Know that I am really really thankful to you.
The Ok function is an ASP.NET base element that returns the data passed to it as argument as JSON. So that object passed to Ok function is converted to application/JSON content type of response and parsed into JSON. I done SYNC request in the same way and Actions on Google accepted it, so I wouldn’t suspect it as the cause of issue. But I don’t see any other causes that may evoke that problem. That’s the reason why I started that issue 😃. I don’t see any ways to solve it at all. Maybe you can write some example with QUERY handling and send it to me? It doesn’t have to be in C#, because I can read other languages as well (from languages known for more than a little people of course 😃).