I'm having an issue with dialogflow, it is sending empty responses to twilio when a new conversation start. Im getting the error Warning - 14103 Invalid Body in the twilio debugger.
- Im sure the webhook is sending a response to dialogflow but dialogflow is sending an empty response to twilio.
- The request takes less than one second
- Dialogflow bot send rigth answers after the third interaction
This is an example of how it looks from whatsapp:
This is the error that im getting from twilio, the request sended from the bot has an empty message:
this is an example of how im sending the responses from the webhook
// send message via agent or twilio according to operation response time
const sendMessage = (message, time, whatsappNumber, agent) => {
if (time >= 4500) {
twilio.sendSimpleMessage(message, whatsappNumber)
agent.add(message) // dialogflow agents needs to return or Unhandled platform response exeception will be thrown
} else {
agent.add(message)
}
}