Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the API.AI always return "Webhook call failed. Error: Webhook response was empty."

When I create the actions on google project and API.AI agent, I use my own service to be API.AI fulfillment webhook. I expect that API.AI will call my webhook. But when I test it by simulator of actions on google, the API.AI always return:

"message": "Unexpected apiai response format: Empty speech response",
"apiResponse": {
  "id": "905d5727-bea8-4630-8d3a-e6c173159a94",
  "timestamp": "2017-09-28T02:20:06.954Z",
  "lang": "en",
  "result": {},
  "status": {
    "code": 206,
    "errorType": "partial_content",
    "errorDetails": "Webhook call failed. Error: Webhook response was empty."
  },
  "sessionId": "1506565201634"
}

But when I check the logs of apache, the API.AI did not call my webhook! When I replace the webhook url to firebace functions, it work success. But if I use my own service url to be API.AI webhook url, the API.AI do not call the webhook anyway. My service use https.

like image 816
肖俊毅 Avatar asked Dec 13 '25 17:12

肖俊毅


1 Answers

I also got this issue and I could manage to solve it. below error details were somehow misleading

"status": {
    "code": 206,
    "errorType": "partial_content",
    "errorDetails": "Webhook call failed. Error: Webhook response was empty."
  }

Actual issue was something else. I was adding output context in response from web-hook and name of context was invalid (it had a space in name). This was causing above error message.

As a general rule, it looks like that above error message will be received when response from web-hook is in invalid format.

Hope it will help someone in future.

like image 167
pgcan Avatar answered Dec 16 '25 13:12

pgcan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!