Reputation: 85
I have created an Action on Actions for Google. It uses Dialogflow to process inputs, and is powered by a PHP webhook. The PHP script is hosted by a 3rd party hosting provider. I'm using v2 of the Dialogflow API.
The agent works successfully in Dialogflow with no issues.
Initially, when testing in the Actions on Google simulator it worked fine.
After submitting my draft action for review, the prodution version did not work. However, reverting back to the draft version it continued to work fine. Consequently, my review submission is rejected.
In the errors tab of the console simulator, it tells me "MalformedResponse 'final_response' must be set." In the 'response' tab it shows the response below:
I have been in contact with support who provided the following suggestions:
Clear my cache and try again
Remove authentication from the script
Webhook is returning an empty response
Response needs to include a Google payload
Check you're using v2 of the API
Could potentially be a result of this known issue
Does anyone have any ideas or suggestions on what else might be causing the issue?
Upvotes: 0
Views: 105
Reputation: 85
For anyone who has a similar issue in the future, I have found the cause.
My PHP script takes the session ID passed from Actions on Google and uses that to set the PHP session_id.
The length of the session ID during testing was 81 characters. The production version passes a session ID which is 148 characters long. The limit for a PHP session_id is 128 characters, so this was causing the script to fail.
Removing this line of code causes issues, because PHP doesn't seem to consistently allocate a session_id during a single conversation which can cause unusual results. Instead, I am hashing the Actions on Google session using sha512 resulting in a 128 character value. I am using this to set the PHP session with no issues.
Upvotes: 0
Reputation: 529
First, make sure you have the webhook enabled toggle on for all your intents and also make sure that if your fulfillment has a promise ensure that the promise is being returned. Alternatively, if you aren't using fulfillment webhook then you need to make sure to have defined a static default response for these intents. You can read more about all of this here in the Dialogflow docs.
Upvotes: 1