Mark Evans
Mark Evans

Reputation: 159

ngrok with DialogFlow for webhook debugging won't work

Last year, I was able to use ngrok to debug a webhook on api.ai (now called DialogFlow) by rerouting a public URL to a port on localhost.

Now, it simply won't work. I get the message "Error: Failed to parse webhook JSON response: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $."

The ngrok session shows "301 Moved Permanently" when DialogFlow executes the webhook, but the app is never reached.

Upvotes: 1

Views: 453

Answers (1)

Prisoner
Prisoner

Reputation: 50711

Dialogflow treats responses besides a "200 ok" as a possible error. Using ngrok still works, but you should point directly to the URL of the webhook rather than the URL of something that will redirect to the webhook.

Upvotes: 1

Related Questions