肖俊毅
肖俊毅

Reputation: 95

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.

Upvotes: 3

Views: 6655

Answers (3)

Satyam Ramawat
Satyam Ramawat

Reputation: 37

@dmulter Sometimes, if your account exceeds its quota limit then also response would be Webhook Failed. enter image description here

Upvotes: 0

pgcan
pgcan

Reputation: 1219

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.

Upvotes: 6

肖俊毅
肖俊毅

Reputation: 95

OK, I solved the problem. The reason is the configuration of https. It should add ca in ssl options. The details of the solution see the link: https://discuss.api.ai/t/webhook-does-not-work-with-https/6708/8

Upvotes: 2

Related Questions